Cities and there are n and m have the channel. If a road has come from a city there is no way to go, then this city's first all the way into a country, each city can only belong to a country, a city on the ring of course, belong to the same country. Q. How many of these cities are divided into at least two countries.
Because the presence of the drawing ring, and in the bipartite graph is a directed acyclic graph when correctly, so the first point with a strong deflation even reconstituted directed acyclic graph. Then bipartite matching.