In country X, there are $$$N$$$ villages numbered from $$$1$$$ to $$$N$$$. There are $$$N - 1$$$ roads, and each road connects two different villages. Each road is numbered $$$1, 2, ..., N - 1$$$, with road $$$i$$$ connecting village $$$x_i$$$ to village $$$y_i$$$.
For any two villages in country X, there is exactly one route connecting them. A route passes through a sequence of distinct villages, and its length is the number of roads on the route.
The government needs to select some villages to build gas stations. According to the law, gas stations must be placed in such a way that for any route of length $$$k$$$, there is at least one village with a gas station. Determine the minimum number of gas stations that need to be placed.
$$$Input:$$$
The first line contains two integers $$$N$$$ and $$$k$$$.
Each of the following $$$N-1$$$ lines contains two integers $$$x_i$$$ and $$$y_i$$$.
$$$Output:$$$
Print the minimum number of gas stations.
$$$Constraint:$$$
$$$1 \le x_i, y_i \le N$$$, $$$x_i ≠ y_i$$$.
$$$1 \le k \le N - 1$$$.
Subtask 1: $$$2 \le N \le 3000$$$.
Subtask 2: $$$2 \le N \le 2.10^5$$$.
$$$Example:$$$
Input:
7 2
1 2
1 3
2 4
2 5
4 6
6 7
Output:
2
Explain: We can put a gas station on nodes 2 and 6 or 2 and 7,...
I need help with subtask 1, but if you can, can you also assist in doing subtask 2? Tks







