SP15577 STC10 - Blockade
Description
There are exactly N towns in Byteotia. Some towns are connected by bidirectional roads. There are no crossroads outside towns, though there may be bridges, tunnels and flyovers. Each pair of towns may be connected by at most one direct road. One can get from any town to any other-directly or indirectly.
Each town has exactly one citizen. For that reason the citizens suffer from loneliness. It turns out that each citizen would like to pay a visit to every other citizen (in his host's hometown), and do it exactly once. So exactly N\*(N-1) visits should take place. That's right, _should_. Unfortunately, a general strike of programmers, who demand an emergency purchase of software, is under way. As an act of protest, the programmers plan to block one town of Byteotia, preventing entering it, leaving it, and even passing through. As we speak, they are debating which town to choose so that the consequences are most severe.
Task
----
Write a programme that:
- reads the Byteotian road system's description from the standard input,
- for each town determines, how many visits could take place if this town were not blocked by programmers,
- writes out the outcome to the standard output.
Input
-----
In the first line of the standard input there are two positive integers: N and N (1
Input Format
N/A
Output Format
N/A