Pro.ID22183 TitleHouses Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22183 AC9 Submit13 Ratio69.23% 时间&空间限制描述There are several houses in a village. Houses are connected by roads, since building a road will cost much money, any two houses are connected by at most one road, and every road is guaranteed to connect two different houses. In the village, the smartest people always live in the most convenient house, and the most convenient house is a house connecting to the maximum number of houses. Now it is your task to find out the number of houses connecting to the most convenient house. 输入There're multiple cases. The first line of each case contains two integers n and m ( 1 ≤ n ≤ 20, 0 ≤ m ≤ 20 ), indicating the number of houses and the number of roads, houses are numbered from 1 to n. Then for each of the following m lines, there are two different integers a and b ( 1 ≤ a, b ≤ n ), indicating that there is a road connecting house a and house b. Input is terminated by two 0's. 输出Description There are several houses in a village. Houses are connected by roads, since building a road will cost much money, any two houses are connected by at most one road, and every road is guaranteed to connect two different houses. In the village, the smartest people always live in the most convenient house, and the most convenient house is a house connecting to the maximum number of houses. Now it is your task to find out the number of houses connecting to the most convenient house. Input There're multiple cases. The first line of each case contains two integers n and m ( 1 ≤ n ≤ 20, 0 ≤ m ≤ 20 ), indicating the number of houses and the number of roads, houses are numbered from 1 to n. Then for each of the following m lines, there are two different integers a and b ( 1 ≤ a, b ≤ n ), indicating that there is a road connecting house a and house b. Input is terminated by two 0's. Output For each case output the result in one line. Sample Input 1 0 Sample Output 0 Hint 请忽略本题。 Source 样例输入1 0 样例输出0 提示请忽略本题。 |