
ZOJ Problem Set  2316
Let us consider undirected graph G = This problem contains multiple test cases! The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks. The output format consists of N output blocks. There is a blank line between output blocks. Input The first line of the input file contains two integer numbers  N and M (2 <= N <= 10 000, 1 <= M <= 100 000). 2M integer numbers follow, forming M pairs, each pair describes one edge of the graph. All edges are different and there are no loops (i.e. edge ends are distinct). Output Output the only number  the sum requested. Sample Input
1 Sample Output
18 Author: Andrew Stankevich Source: Andrew Stankevich's Contest #1 