Even Tree
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given a tree, which is a simple connected graph without cycles.
Find the maximum number of edges that can be removed from the tree to obtain a forest where each connected component contains an even number of nodes.
For example, in the tree with nodes shown below, you can remove at most edge to create an even forest.
Input
The first line contains two integers is even) and — the number of nodes and edges. Each of the next lines contains two integers representing the nodes connected by an edge in the tree. The root of the tree is node .
Output
Print the maximum number of edges that can be removed.
Examples
Input #1
Answer #1
Submissions 102
Acceptance rate 68%