cho.sh
Notes
Loading...

Tree Path Partition

Time limit

1s

Memory limit

128 MB

Problem

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.

  1. No two different paths share a city.
  2. Every city is included in exactly one path.
  3. The length of every path is at most K.

Given the road network and K, find the minimum possible number of paths in a K-path partition.

Input

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.

Output

Print the minimum possible number of paths in a K-path partition.