atcoder#ABC223G. [ABC223G] Vertex Deletion
[ABC223G] Vertex Deletion
Score : points
Problem Statement
Given is a tree with vertices. The vertices are numbered , and the -th edge connects Vertex and Vertex .
Find the number of integers that satisfy the following condition.
- The size of the maximum matching of the graph obtained by deleting Vertex and all incident edges from the tree is equal to the size of the maximum matching of the original tree.
Constraints
- The given graph is a tree.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3
1 2
2 3
2
The size of the maximum matching of the original tree is .
The size of the maximum matching of the graph obtained by deleting Vertex and all incident edges from the tree is .
The size of the maximum matching of the graph obtained by deleting Vertex and all incident edges from the tree is .
The size of the maximum matching of the graph obtained by deleting Vertex and all incident edges from the tree is .
Thus, two integers satisfy the condition, so we should print .
2
1 2
0
6
2 5
3 5
1 4
4 5
4 6
4