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;
const long long N = 2e5 + 10;
long long bx[N], by[N], lenx, leny, n, k;
struct node {
  long long x, y;
} a[N];
struct opt {
  long long l, r, val;
};
vector<opt> v[N];
long long cnt[N], ans[N], las[N];
long long px(long long x) { return lower_bound(bx + 1, bx + 1 + lenx, x) - bx; }
long long py(long long x) { return lower_bound(by + 1, by + 1 + leny, x) - by; }
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (register long long i = (1); i <= (n); ++i) {
    cin >> a[i].x >> a[i].y;
    bx[++lenx] = a[i].x;
    bx[++lenx] = a[i].x + k;
    by[++leny] = a[i].y;
    by[++leny] = a[i].y + k;
  }
  sort(bx + 1, bx + 1 + lenx);
  lenx = unique(bx + 1, bx + 1 + lenx) - (bx + 1);
  sort(by + 1, by + 1 + leny);
  leny = unique(by + 1, by + 1 + leny) - (by + 1);
  for (register long long i = (1); i <= (n); ++i) {
    v[py(a[i].y)].push_back((opt){px(a[i].x), px(a[i].x + k), 1});
    v[py(a[i].y + k)].push_back((opt){px(a[i].x), px(a[i].x + k), -1});
  }
  long long l, r, t, len;
  for (register long long i = (1); i <= (leny); ++i) {
    len = v[i].size();
    for (register long long j = (0); j <= (len - 1); ++j) {
      l = v[i][j].l, r = v[i][j].r;
      t = v[i][j].val;
      for (register long long k = (l); k <= (r - 1); ++k) {
        cnt[k] += t;
        if (las[k] != i)
          ans[cnt[k] - t] += 1ll * (bx[k + 1] - bx[k]) * (by[i] - by[las[k]]);
        las[k] = i;
      }
    }
  }
  for (register long long i = (1); i <= (n); ++i) cout << ans[i] << ' ';
  cout << '\n';
  return 0;
}