#Q105. 「一本通 3.6 练习 4」电力
「一本通 3.6 练习 4」电力
Description
Original source: CTU Open 2004
Given an undirected graph, determine the maximum number of connected components after deleting one vertex.
Input Format
Multiple test cases. The first line contains two integers and , representing the number of vertices and edges, respectively.
The next lines each contain two integers and , indicating an edge between and . There are no duplicate edges. Input ends with 0 0.
Output Format
Output the result for each test case on a separate line.
Sample 1
3 3
0 1
0 2
2 1
4 2
0 1
2 3
3 1
1 0
0 0
1
2
2
Constraints and Hints