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 fl, 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 l, r, t;
} a[200005], w[200005];
bool cmp(O a, O b) { return a.l < b.l; }
void up(int u) { s[u] = s[lc[u]] + s[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 (!u) {
    l = r = 0;
    return;
  }
  if (w[u].l <= k && k <= w[u].r) {
    l = u;
    r = rc[u];
    rc[u] = 0;
    if (k < w[u].r) {
      fl = ++t;
      s[t] = 1;
      w[t] = (O){k + 1, w[u].r, w[u].t};
    } else
      fl = 0;
    w[u].r = k;
    up(u);
  } else if (k < w[u].l) {
    split(lc[u], k, l, lc[u]);
    r = u;
    up(u);
  } else {
    split(rc[u], k, rc[u], r);
    l = u;
    up(u);
  }
}
void join(int &u, int v) {
  if (1ll * rand() * (s[u] + 1) <= RAND_MAX) {
    split(u, w[v].l, lc[v], rc[v]);
    up(v);
    u = v;
  } else if (w[u].l < w[v].l) {
    join(rc[u], v);
    up(u);
  } else {
    join(lc[u], v);
    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].r - w[u].l + 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].r - w[u].l + 1;
  dfs(lc[u], x);
  dfs(rc[u], x);
}
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].r, a[i].r + K - 1, a[i].t};
    split(rt, u.r, B, C);
    if (fl) join(C, fl);
    split(B, u.l - 1, A, B);
    if (fl) join(B, fl);
    I = a[i].l;
    dfs(B, u.t);
    rt = merg(merg(A, B), C);
  }
  for (int i = 1; i <= n; ++i) printf("%lld ", ans[i]);
  puts("");
  return 0;
}