题目描述
Problem Description
You are given a tree $ T $ consisting of $ N $ vertices numbered from $ 1 $ to $ N $. The $ i $ -th edge connects vertices $ A_i $ and $ B_i $.
You can perform the following operation any number of times (including zero):
- Choose two leaves $ u, v $ in $ T $ such that the distance between them is odd. Then, remove $ u, v $ (along with the edges connected to them) from $ T $.
Here, a vertex is considered a leaf if, at the time of the operation, its degree is exactly $ 1 $. The distance between two vertices is defined as the number of edges in the path connecting them.
Find the number of possible sets of vertices that can remain in $ T $ after the operations, modulo $ 998244353 $.
Input Format
The input is given from the standard input in the following format:
$ N $ $ A_1 $ $ B_1 $ $ A_2 $ $ B_2 $ $\vdots$ $ A_{N-1} $ $ B_{N-1} $
Output Format
Output the answer.
Sample Input and Output
Sample Input #1
4
1 2
2 3
3 4
Sample Output #1
3
Sample Input #2
5
2 1
3 1
4 1
5 3
Sample Output #2
3
Sample Input #3
8
2 1
3 2
4 1
5 2
6 5
7 3
8 7
Sample Output #3
11
Sample Input #4
24
12 7
14 4
8 13
24 13
1 3
4 9
17 2
1 21
24 22
11 1
15 17
22 5
23 10
24 12
13 6
12 16
10 21
19 22
20 17
4 20
20 6
10 18
21 6
Sample Output #4
5359
Notes/Hints
Constraints
- $2 \leq N \leq 150$
- $1 \leq A_i, B_i \leq N$
- The graph given in the input is a tree.
- All values in the input are integers.
Sample Explanation 1
By not performing any operations, you can obtain the vertex set $\{1,2,3,4\}$. By removing the leaves $ 1,4 $ of $ T $, you can obtain the vertex set $\{2,3\}$. Further removing the leaves $ 2,3 $ from this, you can obtain the vertex set $\{\}$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分