Problem: Snow Queen told Kay to form a word "eternity" using pieces of ice. Kay is eager to deal with the task, because he will then become free, and Snow Queen will give him all the world and a pair of skates.

Behind the palace of the Snow Queen there is an infinite field consisting of cells. There are n pieces of ice spread over the field, each piece occupying exactly one cell and no two pieces occupying the same cell. To estimate the difficulty of the task Kay looks at some squares of size k × k cells, with corners located at the corners of the cells and sides parallel to coordinate axis and counts the number of pieces of the ice inside them.

This method gives an estimation of the difficulty of some part of the field. However, Kay also wants to estimate the total difficulty, so he came up with the following criteria: for each x (1 ≤ x ≤ n) he wants to count the number of squares of size k × k, such that there are exactly x pieces of the ice inside.

Please, help Kay estimate the difficulty of the task given by the Snow Queen.

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 100 000, 1 ≤ k ≤ 300) — the number of pieces of the ice and the value k, respectively. Each of the next n lines contains two integers xi and yi ( - 109 ≤ xi, yi ≤ 109) — coordinates of the cell containing i-th piece of the ice. It's guaranteed, that no two pieces of the ice occupy the same cell.

Output

Print n integers: the number of squares of size k × k containing exactly 1, 2, ..., n pieces of the ice.

Example

Input

5 3
4 5
4 6
5 5
5 6
7 7


Output

10 8 1 4 0 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int h[200005], d[200005], cnt, n, K, I, x, y, m, t, rt, A, B, C, s[200005],
    lc[200005], rc[200005];
long long f[100005], g[100005], ans[100005];
struct O {
  int x, y, t;
} a[200005], w[200005];
bool cmp(O a, O b) { return a.x < b.x; }
void up(int u) {
  s[u] = s[lc[u]] + s[rc[u]] + 1;
  h[u] = max(h[lc[u]], h[rc[u]]) + 1;
}
int merg(int l, int r) {
  if (!l || !r) return l + r;
  if (1ll * rand() * (s[l] + s[r]) < 1ll * s[l] * RAND_MAX) {
    rc[l] = merg(rc[l], r);
    up(l);
    return l;
  } else {
    lc[r] = merg(l, lc[r]);
    up(r);
    return r;
  }
}
void split(int u, int k, int &l, int &r) {
  if (w[u].x <= k && k <= w[u].y) {
    int p = lc[u], q = rc[u];
    if (k < w[u].y) {
      r = ++t;
      s[r] = 1;
      w[r] = (O){k + 1, w[u].y, w[u].t};
    } else
      r = 0;
    l = u;
    s[l] = 1;
    w[l] = (O){w[u].x, k, w[u].t};
    lc[l] = rc[l] = 0;
    l = merg(p, l);
    r = merg(r, q);
  } else if (k < w[u].x) {
    split(lc[u], k, l, lc[u]);
    r = u;
    up(u);
  } else {
    split(rc[u], k, rc[u], r);
    l = u;
    up(u);
  }
}
void dfs(int u, int x) {
  if (!u) return;
  ans[w[u].t] += f[w[u].t] * (I - g[w[u].t]);
  g[w[u].t] = I;
  f[w[u].t] -= w[u].y - w[u].x + 1;
  w[u].t += x;
  ans[w[u].t] += f[w[u].t] * (I - g[w[u].t]);
  g[w[u].t] = I;
  f[w[u].t] += w[u].y - w[u].x + 1;
  dfs(lc[u], x);
  dfs(rc[u], x);
}
void PA(int u) {
  if (!u) return;
  PA(lc[u]);
  d[++t] = u;
  PA(rc[u]);
}
void build(int &u, int l, int r) {
  if (l > r) {
    u = 0;
    return;
  }
  u = d[l + r >> 1];
  build(lc[u], l, (l + r >> 1) - 1);
  build(rc[u], (l + r >> 1) + 1, r);
  up(u);
}
int main() {
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x, &y);
    a[++m] = (O){x, y, 1};
    a[++m] = (O){x + K, y, -1};
  }
  sort(a + 1, a + m + 1, cmp);
  for (int i = 0; i <= n; ++i) g[i] = -1000005000;
  rt = t = 1;
  s[1] = 1;
  w[1] = (O){-1000005000, 1000005000, 0};
  for (int i = 1; i <= m; ++i) {
    O u = {a[i].y, a[i].y + K - 1, a[i].t};
    split(rt, u.y, B, C);
    split(B, u.x - 1, A, B);
    I = a[i].x;
    dfs(B, u.t);
    rt = merg(merg(A, B), C);
    if (h[rt] > 350) {
      t = 0;
      PA(rt);
      build(rt, 1, t);
    }
  }
  for (int i = 1; i <= n; ++i) printf("%lld ", ans[i]);
  puts("");
  return 0;
}