Time limit
1s
Memory limit
128 MB
There are N cities and N - 1 roads. The road network is a tree, so there is exactly one simple path between any two cities.
The path between two cities u and v is the sequence of cities visited while moving along adjacent roads from u to v, without visiting the same city twice. The length of a path is the number of roads on that path.
For a positive integer K, a K-path partition of the tree is a set of paths satisfying all of the following conditions.
Given the road network and K, find the minimum possible number of paths in a K-path partition.
The first line contains two integers N and K. N is the number of cities and satisfies 2 <= N <= 300000. K is an integer satisfying 1 <= K <= N - 1.
Each of the next N - 1 lines contains two integers, the endpoints of one road.
Print the minimum possible number of paths in a K-path partition.