Justin is very rich and he owns a city. The road forms a tree consisting of
A tree's vertex is called a leaf if it has exactly one vertex adjacent to it. The distance between two vertices is the number of edges on the shortest path between them.
As suggested by sjkmost, Justin forces the citizens to trip with zipline. He built residential areas on the leaves and zipline stations on other vertices. Adjacent vertices are connected by ziplines.
Now Justin wants to group residential areas into regions. He wants to offer the residents convenient traffic, so the distance between every two residential areas in the region should not be greater than
This problem is too easy for Justin, so he solved it in a second.
lhyyy travelled to this city to visit Justin. However, he is not good at graph theory at all and he got lost. Can you find out how many regions there are in the city for lhyyy?
In other words, given a tree, you should split the leaves into sets such that the distance between any two leaves in the same set is not greater than
The first line contains two integers
The
Print a single integer — the minimal number of sets the split can have.
5 2
1 2
1 3
3 4
3 5
2
For 20% testcases,
For 40% testcases,
For another 10% testcases,
For another 10% testcases,
For another 10% testcases, it is guaranteed that the data is generated randomly.
For 100% testcases,