|
||||||||||
Even Tree SplitTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 653 Accepted Submission(s): 281 Problem Description You are given an undirected tree with $n$ nodes. It's guaranteed that $n$ is even. You are going to delete some of the edges (at least $1$), and have to let each of the remaining connected components have an even number of vertices. Calculate the number of ways to delete the edges that satisfy such constraints, modulo $998244353$. Input The first line contains an integer $T(1 \leq T \leq 30)$ - the number of test cases. The first line of each test case contains an integer $n(1 \leq n \leq 10^5)$ - the number of vertices on the tree. The next $n-1$ lines of each test case contain two integers $u,v(1 \leq u,v \leq n)$, representing an edge between $u$ and $v$. It is guaranteed that the input graph is a tree with even number of vertices. Output For each test case, output the number of ways to delete the edges that satisfy such constraints in a single line, modulo $998244353$. Sample Input
Sample Output
Source | ||||||||||
|