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<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std;
int n,K,h[1001010],m1,g[1001010],f[1001010];
int siz[1001010],ans;
struct edge{
	int next,to;
	edge(int next=0,int to=0):
	next(next),to(to){}
}q[2020200];
void Addedge(){
	int x,y; scanf("%d %d",&x,&y);
	q[++m1]=edge(h[x],y); h[x]=m1;
	q[++m1]=edge(h[y],x); h[y]=m1;
}
void Dfs1(int x,int fa){
	siz[x]=1;
	for (int i=h[x];i;i=q[i].next){
		int y=q[i].to;
		if (y==fa) continue;
		Dfs1(y,x); siz[x]+=siz[y];
	}
}
void Dfs2(int x,int fa){
	int Max1=-21001010,Max2=-21001010;
	for (int i=h[x];i;i=q[i].next){
		int y=q[i].to;
		if (y==fa) continue;
		Dfs2(y,x);
		if (siz[y]>=K) f[x]++;
		if (f[y]-g[y]>Max1) Max2=Max1,Max1=f[y]-g[y];
		else if (f[y]-g[y]>Max2) Max2=f[y]-g[y];
	}
	
	if (siz[x]>=K) g[x]=1;
	ans=max(ans,f[x]+Max1+(n-siz[x]>=K)); 
	ans=max(ans,f[x]+Max1+Max2+(n-siz[x]>=K));
	f[x]=max(f[x],f[x]+Max1);
}
int main(){
	scanf("%d %d",&n,&K);
	for (int i=1;i<n;i++) Addedge();
	Dfs1(1,0); Dfs2(1,0);
	cout<<ans<<endl;
}