Problem: You are given a tree $T$ and an integer $K$. You can choose arbitrary distinct two vertices $u$ and $v$ on $T$. Let $P$ be the simple path between $u$ and $v$. Then, remove vertices in $P$, and edges such that one or both of its end vertices is in $P$ from $T$. Your task is to choose $u$ and $v$ to maximize the number of connected components with $K$ or more vertices of $T$ after that operation.



Input

The input consists of a single test case formatted as follows.


$N$ $K$
$u_1$ $v_1$
:
$u_{N-1}$ $v_{N-1}$


The first line consists of two integers $N, K$ ($2 \leq N \leq 100,000, 1 \leq K \leq N$). The following $N-1$ lines represent the information of edges. The ($i+1$)-th line consists of two integers $u_i, v_i$ ($1 \leq u_i, v_i \leq N$ and $u_i \ne v_i $ for each $i$). Each $\\{u_i, v_i\\}$ is an edge of $T$. It's guaranteed that these edges form a tree.

Output

Print the maximum number of connected components with $K$ or more vertices in one line.

Examples

Input

2 1
1 2


Output

0


Input

7 3
1 2
2 3
3 4
4 5
5 6
6 7


Output

1


Input

12 2
1 2
2 3
3 4
4 5
3 6
6 7
7 8
8 9
6 10
10 11
11 12


Output

4


Input

3 1
1 2
2 3


Output

1


Input

3 2
1 2
2 3


Output

0


Input

9 3
1 2
1 3
1 4
4 5
4 6
4 7
7 8
7 9


Output

2

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int n, k;
vector<int> G[100001];
int cnt[100001];
int gettt[100001];
int val[100001];
int ans = 0;

int dfs(int v, int p) {
	int ans = 1;
	for (int i = 0; i < G[v].size(); i++) {
		if (G[v][i] != p) {
			ans += dfs(G[v][i], v);
		}
	}
	return (cnt[v] = ans);
}

void solve(int v, int p) {
	int maxi = -1;
	int tp = n;
	for (int i = 0; i < G[v].size(); i++) {
		int nv = G[v][i];
		if (nv != p) {
			solve(nv, v);
		}
	}
	for (int i = 0; i < G[v].size(); i++) {
		int nv = G[v][i];
		if (nv != p) {
			int cv = val[nv];
			if (cnt[nv] >= k) {
				cv--;
			}
			if (maxi <= cv) {
				if (maxi < cv)tp = cnt[v];
				else tp = min(cnt[v], tp);
				maxi = max(cv, maxi);
			}
		}
	}
	int tmp = 0;
	if (n - cnt[v] >= k)tmp++;
	ans = max(ans, maxi + tmp + gettt[v]);
	//printf("%d\n",maxi);

	val[v] = max(val[v], maxi+gettt[v]);
	//printf("%d an1=%d va=%d\n",v,ans,val[v]);
	maxi = -1;
	int maxi2 = -1;
	if (G[v].size() <= 2)return;
	for (int i = 0; i < G[v].size(); i++) {
		int nv = G[v][i];
		if (nv != p) {
			int cv = val[nv];
			if (cnt[nv] >= k) {
				cv--;
			}
			if (maxi < cv) {
				maxi2 = maxi;
				maxi = cv;
			} else if (maxi2 < cv) {
				maxi2 = cv;
			}
		}
	}
	//printf("%d %d %d %d\n",v,maxi,maxi2,gettt[v]);
	//printf("%d %d\n",val[v],tmp);
	ans = max(ans, maxi + maxi2 + tmp + gettt[v]);
	//printf("%d an2=%d\n",v,ans);
}

int main(void) {
	scanf("%d%d", &n, &k);
	for (int i = 0; i < n - 1; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		u--;
		v--;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < G[i].size(); j++) {
		}
	}
	dfs(0, -1);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < G[i].size(); j++) {
			int nv = G[i][j];
			if (cnt[nv] < cnt[i]) {
				if (cnt[nv] >= k)gettt[i]++;
			}
		}
		val[i] = gettt[i];
	}
	solve(0, -1);
	printf("%d\n", ans);
	return 0;
}