Recently, the government of Pashmakistan has faced a severe budget deficit. For this…
- User
Recently, the government of Pashmakistan has faced a severe budget deficit. For this reason, he has decided to auction the country's roads. This plan is such that the government signs a contract with a number of private companies and assigns each of the roads to one of the companies. Each company takes responsibility for maintaining a number of roads and generates revenue by charging tolls from those who use those roads.
Unlike other countries, Pashmakistan has two capitals, and many people commute between these two capitals every day. Each company will only contract with the government if it is guaranteed to generate revenue from those traveling between the two capitals. In other words, the government should allocate roads to each company in such a way that every person has to pass through at least one of the roads belonging to that company to travel from one capital to another.
The government plans to contract with as many companies as possible to maximize its profit from this plan. To help the government, announce the maximum possible number of companies for the contract.
input In the first line of the input, two numbers n n (the number of cities in Pashmakistan) and m m (the number of roads in Pashmakstan).
1 ≤ n , m ≤ 1 0 5 1≤n, m≤10 5
In the second line, two numbers s s and t t are the numbers of the capitals of Pashmakistan. (Pashmakistan cities from 1 to n n are numbered.)
1 ≤ s , t ≤ n 1 ≤ s, t ≤ n
in each of m m next line, two numbers a a and b b has arrived. It means a two-way road between cities a a and b There is b.
1 ≤ a , b ≤ n 1 ≤ a, b ≤ n
output On the only output line, print the maximum number of companies that the government can contract with.
examples Sample entry 1 4 4 1 4 1 2 1 3 2 4 3 4 Plain text Sample output 1 2 write in c++
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.