405301: GYM101875 J Protecting Fancouver

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Protecting Fancouvertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Friendo is a super hero that protects the city of Fancouver from bad games. He knows that a new game from the Velda franchise - one that tricks people into thinking it's good and makes them go crazy - will be released in the next few days and is going to be sold at N game stores.

In Fancouver, the game stores have a mafia and are connected in such a way that there is always one path and only one path from one to another, so that when you want to go to from one game store to another, you may have to visit stores you didn't want to visit and end up buying games you didn't want to buy.

With his power, Friendo can destroy any number of stores, as long as the distance between any two of them is at most K. What is the largest number of stores that Friendo can destroy?

Input

The input starts with a single line containing two integers N and K (1 ≤ K < N ≤ 105). Each of the following N - 1 lines contains two integers u, v (1 ≤ u < v ≤ N) indicating that game store u is connected to game store v.

Output

Output a single integer that indicates the largest number of game stores Friendo can destroy.

ExampleInput
6 2
2 3
3 5
6 4
6 3
1 6
Output
4

Source/Category

加入题单

算法标签: