{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk. \n \u003cbr\u003eSo the teacher came up with an idea: Vote. Every child have some nice handkerchiefs, and if he/she think someone is suitable for the role of Hawk, he/she gives a handkerchief to this kid, which means this kid who is given the handkerchief win the support. Note the support can be transmitted. Kids who get the most supports win in the vote and able to play the role of Hawk.(A note:if A can win \n \u003cbr\u003esupport from B(A !\u003d B) A can win only one support from B in any case the number of the supports transmitted from B to A are many. And A can\u0027t win the support from himself in any case. \n \u003cbr\u003eIf two or more kids own the same number of support from others, we treat all of them as winner. \n \u003cbr\u003eHere\u0027s a sample: 3 kids A, B and C, A gives a handkerchief to B, B gives a handkerchief to C, so C wins 2 supports and he is choosen to be the Hawk. \n\u003c/div\u003e\n\u003cbr\u003e有n个小朋友在一个班级中,现在要选择班长。收集了小朋友们的意见,一条意见表示为A认为B合适。这个是具备传递性的,A认为B合适,B认为C合适。那么A也会认为C合适。\n\u003cbr\u003e现在需要提供一份候选人名单,这里面的人,是被最多的人,认为合适的。\n\n"}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases. First is a integer T(T \u0026lt;\u003d 50), means the number of test cases. \n\u003cbr\u003eEach test case start with two integer n, m in a line (2 \u0026lt;\u003d n \u0026lt;\u003d 5000, 0 \u0026lt;m \u0026lt;\u003d 30000). n means there are n children(numbered from 0 to n - 1). Each of the following m lines contains two integers A and B(A !\u003d B) denoting that the child numbered A give a handkerchief to B.\n\u003cbr\u003e第一个整数,表示测试数据的组数。\n\u003cbr\u003e每组数据,第一行两个整数n和m\n\u003cbr\u003e接下来m行,每行两个整数a,b,表示a认为b合适,小朋友的编号为0~n-1\n"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, the output should first contain one line with \"Case x:\", here x means the case number start from 1. Followed by one number which is the total \n\u003cfont color\u003d\"red\"\u003esupports\u003c/font\u003e the winner(s) get. \n\u003cbr\u003eThen follow a line contain all the Hawks\u0027 number. The numbers must be listed in increasing order and separated by single spaces.\n\u003cbr\u003e对于每组数据,先输出Case编号。接下来一个整数表示最多的票数。接下来是满足条件的小朋友编号,从小到大输出。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n4 3\n3 2\n2 0\n2 1\n\n3 3\n1 0\n2 1\n0 2\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase 1: 2\n0 1\nCase 2: 2\n0 1 2\u003c/pre\u003e"}}]}