{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"epigraph\"\u003e\u003cdiv class\u003d\"epigraph-text\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eI love the lotus because while growing from mud, it is unstained.\u003c/span\u003e\u003c/div\u003e\u003cdiv class\u003d\"epigraph-source\"\u003e— Zhou Dunyi, \u003cspan class\u003d\"tex-font-style-it\"\u003eOn the Love of the Lotus\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eTN\u003c/span\u003e was gifted a tree of $$$n$$$ vertices with the root in the vertex $$$1$$$. A tree is a connected undirected graph without cycles.\u003c/p\u003e\u003cp\u003eInitially, the root has already been colored, and he wanted to color all the vertices using the operation below.\u003c/p\u003e\u003cp\u003eDuring one operation, \u003cspan class\u003d\"tex-font-style-it\"\u003eTN\u003c/span\u003e can choose one uncolored vertex whose parent has already been colored and color it.\u003c/p\u003e\u003cp\u003eIt can be shown that after $$$n-1$$$ operations, all the vertices will be colored.\u003c/p\u003e\u003cp\u003eLet $$$p_i$$$ be the chosen vertex of the $$$i$$$-th operation. If \u003cspan class\u003d\"tex-font-style-it\"\u003eTN\u003c/span\u003e can color all vertices in this way, then the array $$$p$$$ is called \u003cspan class\u003d\"tex-font-style-it\"\u003eValid\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eCount the number of different \u003cspan class\u003d\"tex-font-style-it\"\u003eValid\u003c/span\u003e arrays modulo $$$998244353$$$.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$t$$$ $$$(1 \\leq t \\leq 10 ^ 4)$$$, denoting the number of test cases.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains a single integer $$$n$$$ $$$(1 \\leq n \\leq 10 ^ 5)$$$.\u003c/p\u003e\u003cp\u003eThe $$$i$$$-th of the next $$$n-1$$$ lines contains two integers $$$u_i$$$, $$$v_i$$$ $$$(1 \\leq u_i, v_i \\leq n)$$$, denoting the indices of vertices connected by the $$$i$$$-th edge.\u003c/p\u003e\u003cp\u003eIt\u0027s guaranteed that the sum of $$$n$$$ over all test cases doesn\u0027t exceed $$$2 \\times 10 ^ 5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output a single integer, denoting the number of different \u003cspan class\u003d\"tex-font-style-it\"\u003eValid\u003c/span\u003e arrays modulo $$$998244353$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e4\n3\n1 2\n1 3\n4\n1 2\n2 3\n3 4\n1\n6\n1 2\n1 3\n2 4\n2 5\n3 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1\n1\n20\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, there are two arrays that satisfy the condition: $$$p_1 \u003d \\{2, 3\\}, p_2 \u003d \\{3, 2\\}$$$, which means \u003cspan class\u003d\"tex-font-style-it\"\u003eTN\u003c/span\u003e can color the vertex $$$2$$$ at first and then color the vertex $$$3$$$, or he can color the vertex $$$3$$$ at first and then color the vertex $$$2$$$.\u003c/p\u003e\u003ccenter\u003e \u003ctable class\u003d\"tex-tabular\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-text-align-center\"\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/8017175e99832035ff5dc18e14ae6c02?v\u003d1726273189\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"151px\"\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-text-align-center\"\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/f0772d1b6584cc88c1010614ef44173f?v\u003d1726273189\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"151px\"\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-text-align-center\"\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/5d8d9358255853dab133d1a825ec133b?v\u003d1726273189\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"151px\"\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-text-align-center\"\u003e\u003cspan class\u003d\"tex-font-size-small\"\u003eCase 1\u003c/span\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-text-align-center\"\u003e\u003cspan class\u003d\"tex-font-size-small\"\u003eCase 2\u003c/span\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-text-align-center\"\u003e\u003cspan class\u003d\"tex-font-size-small\"\u003eCase 3\u003c/span\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e \u003c/center\u003e\u003cp\u003eIn the second test case, it can be shown that only one array satisfies the condition: $$$p\u003d\\{2,3,4\\}$$$, which means \u003cspan class\u003d\"tex-font-style-it\"\u003eTN\u003c/span\u003e can color the vertex $$$2$$$ at first, then color the vertex $$$3$$$, and at last, color the vertex $$$4$$$.\u003c/p\u003e\u003cp\u003eIn the third test case, note that the empty array is also \u003cspan class\u003d\"tex-font-style-it\"\u003eValid\u003c/span\u003e.\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/45303c15a03b3d9861f45bf7e58955b3?v\u003d1726273189\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"227px\"\u003e \u003cspan class\u003d\"tex-font-size-small\"\u003eCase 4\u003c/span\u003e \u003c/center\u003e"}}]}