{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eLittle Sub has an unrooted tree with $n$ vertices. He would like to choose $k$ special vertices $s_1,s_2,\\dots,s_k$ and encode each vertex $u$ as an array of $k$ elements in the following way: the $i$-th element equals to the number of vertices in the shortest path from $s_i$ to $u$.\u003c/p\u003e\n\n\u003cp\u003eEach vertex should have a unique encoding. Little Sub would like to find the minimum $k$.\u003c/p\u003e\n\n\u003ch4\u003eInput\u003c/h4\u003e\n\u003cp\u003eThere are multiple test cases. The first line of input contains an integer $T$ indicating the number of test cases. For each test case:\u003c/p\u003e\n\n\u003cp\u003eThe first line contains an integer $n$ ($2 \\le n \\le 10^5$) -- the number of vertices in the tree. Each of the next $n-1$ lines contains two integers $u_i$ and $v_i$ $(1 \\le u_i, v_i \\le n, u_i \\ne v_i)$ -- an edge in the tree.\u003c/p\u003e\n\n\u003cp\u003eIt is guaranteed that the sum of all $n$ does not exceed $10^6$.\u003c/p\u003e\n\n\u003ch4\u003eOutput\u003c/h4\u003e\n\u003cp\u003eFor each test case, output an integer $k$ in the first line denoting the minimum number of special vertices. Then in the second line, output $k$ integers $s_1,s_2,\\dots,s_k$ denoting a possible solution.\u003c/p\u003e\n\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\n4\n4 1\n4 2\n4 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}