Score : 500 points
Rng has a connected undirected graph with N vertices. Currently, there are M edges in the graph, and the i-th edge connects Vertices A_i and B_i.
Rng will add new edges to the graph by repeating the following operation:
Find the maximum possible number of edges that can be added.
Input is given from Standard Input in the following format:
N M A_1 B_1 A_2 B_2 : A_M B_M
Find the maximum possible number of edges that can be added.
6 5 1 2 2 3 3 4 4 5 5 6
4
If we add edges as shown below, four edges can be added, and no more.
5 5 1 2 2 3 3 1 5 4 5 1
5
Five edges can be added, for example, as follows: