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 <vector>
#include <algorithm>
#include <tuple>
#include <utility>
#include <cstring>
#include <iostream>
#include <cstdio>
using namespace std;
using ll = long long int;
using Graph = vector< vector<int> >;

/*
void chmax(ll &A, const ll B) {
  A = max(A, B);
}
*/

ll N, K, dp[100010][2][2], sz[100010];

void dfs(Graph &G, int cur, int par=-1) {
  sz[cur] = 1;
  for(auto to : G[cur]) {
    if(to == par) continue;
    dfs(G, to, cur);
    sz[cur] += sz[to];
  }
}

int solve(Graph &G, int cur, int f1, int f2, int par=-1) {
  if(dp[cur][f1][f2] >= -1) return dp[cur][f1][f2];

  ll val = -1;
  if(f1 == 0) {
    if(f2 == 0) {
      val = 0;
      for(auto to : G[cur]) {
        if(to == par) continue;
        val += (sz[to] >= K);
      }
    }

    if(f2 == 1) {
      for(auto to : G[cur]) {
        if(to == par) continue;
        ll tmp = solve(G, to, 0, 1, cur);
        if(tmp >= 0) val = max(val, tmp);

        tmp = solve(G, to, 1, 1, cur);
        if(tmp >= 0) {
          tmp += (N - sz[to]) >= K;
          val = max(val, tmp);
        }
      }
    }

    return dp[cur][f1][f2] = val;
  }
  if(f1 == 1) {
    int M = G[cur].size();
    vector<ll> dpcur(3, -1);
    dpcur[0] = 0;
    for(size_t i=0; i<G[cur].size(); i++) {
      int to = G[cur][i];
      if(to == par) continue;
      
      vector<ll> dpnxt(3, -1);
      for(int j=0; j<=2; j++) {
        if(dpcur[j] < 0) continue;
        
        // take
        if(j < 2) {
          ll tmp = solve(G, to, 1, 0, cur);
          if(tmp >= 0) {
            dpnxt[j+1] = max(dpnxt[j+1], dpcur[j] + tmp);
          }
        }

        // do not take
        dpnxt[j] = max(dpnxt[j], dpcur[j] + (sz[to] >= K));
      }
      swap(dpcur, dpnxt);
    }

    if(f2 == 0) {
      return dp[cur][f1][f2] = (val = max(dpcur[0], dpcur[1]));
    }
    if(f2 == 1) {
      return dp[cur][f1][f2] = (val = max(dpcur[1], dpcur[2]));
    }
  }
}

int main() {
  cin >> N >> K;

  Graph G(N);
  for(int i=0; i<N-1; i++) {
    int u, v; cin >> u >> v;
    u--; v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }

  fill(dp[0][0], dp[N+1][0], -2);
  dfs(G, 0);
  cout << max(solve(G, 0, 0, 1), solve(G, 0, 1, 1)) << endl;

  /*
  for(int i=0; i<N; i++) {
    for(int f1=0; f1<2; f1++) {
      for(int f2=0; f2<2; f2++) {
        fprintf(stderr, "dp[%d][%d][%d] = %lld\n", i, f1, f2, dp[i][f1][f2]);
      }
    }
  }
  */
  return 0;
}