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;
template <typename T>
inline void ckmax(T& x, T y) {
  x = (y > x ? y : x);
}
template <typename T>
inline void ckmin(T& x, T y) {
  x = (y < x ? y : x);
}
namespace Fread {
const int SIZE = 1 << 21;
char buf[SIZE], *S, *T;
inline char getchar() {
  if (S == T) {
    T = (S = buf) + fread(buf, 1, SIZE, stdin);
    if (S == T) return '\n';
  }
  return *S++;
}
}  // namespace Fread
namespace Fwrite {
const int SIZE = 1 << 21;
char buf[SIZE], *S = buf, *T = buf + SIZE;
inline void flush() {
  fwrite(buf, 1, S - buf, stdout);
  S = buf;
}
inline void putchar(char c) {
  *S++ = c;
  if (S == T) flush();
}
struct NTR {
  ~NTR() { flush(); }
} ztr;
}  // namespace Fwrite
namespace Fastio {
struct Reader {
  template <typename T>
  Reader& operator>>(T& x) {
    char c = Fread ::getchar();
    T f = 1;
    while (c < '0' || c > '9') {
      if (c == '-') f = -1;
      c = Fread ::getchar();
    }
    x = 0;
    while (c >= '0' && c <= '9') {
      x = x * 10 + (c - '0');
      c = Fread ::getchar();
    }
    x *= f;
    return *this;
  }
  Reader& operator>>(char& c) {
    c = Fread ::getchar();
    while (c == '\n' || c == ' ') c = Fread ::getchar();
    return *this;
  }
  Reader& operator>>(char* str) {
    int len = 0;
    char c = Fread ::getchar();
    while (c == '\n' || c == ' ') c = Fread ::getchar();
    while (c != '\n' && c != ' ') {
      str[len++] = c;
      c = Fread ::getchar();
    }
    str[len] = '\0';
    return *this;
  }
  Reader() {}
} cin;
const char endl = '\n';
struct Writer {
  template <typename T>
  Writer& operator<<(T x) {
    if (x == 0) {
      Fwrite ::putchar('0');
      return *this;
    }
    if (x < 0) {
      Fwrite ::putchar('-');
      x = -x;
    }
    static int sta[45];
    int top = 0;
    while (x) {
      sta[++top] = x % 10;
      x /= 10;
    }
    while (top) {
      Fwrite ::putchar(sta[top] + '0');
      --top;
    }
    return *this;
  }
  Writer& operator<<(char c) {
    Fwrite ::putchar(c);
    return *this;
  }
  Writer& operator<<(char* str) {
    int cur = 0;
    while (str[cur]) Fwrite ::putchar(str[cur++]);
    return *this;
  }
  Writer& operator<<(const char* str) {
    int cur = 0;
    while (str[cur]) Fwrite ::putchar(str[cur++]);
    return *this;
  }
  Writer() {}
} cout;
}  // namespace Fastio
const int MAXN = 1e5;
int n, K, cnt, cnt_val;
long long vals[MAXN * 2 + 5];
struct Event {
  long long x, l, r;
  int t;
  Event() {}
  Event(long long _x, long long _l, long long _r, int _t) {
    x = _x;
    l = _l;
    r = _r;
    t = _t;
  }
} event[MAXN * 2 + 5];
bool cmp(Event lhs, Event rhs) { return lhs.x < rhs.x; }
int c[MAXN * 2 + 5];
long long ans[MAXN + 5];
long long lenx;
void modify(int p, int v) {
  long long len = vals[p + 1] - vals[p];
  ans[c[p]] -= len * lenx;
  c[p] += v;
  assert(c[p] >= 0);
  assert(c[p] <= n);
  ans[c[p]] += len * lenx;
}
int main() {
  Fastio ::cin >> n >> K;
  for (int i = 1; i <= n; ++i) {
    long long x, y;
    Fastio ::cin >> x >> y;
    event[++cnt] = Event(x, y - K + 1, y, 1);
    event[++cnt] = Event(x + K, y - K + 1, y, -1);
    vals[++cnt_val] = y - K + 1;
    vals[++cnt_val] = y + 1;
  }
  sort(event + 1, event + cnt + 1, cmp);
  sort(vals + 1, vals + cnt_val + 1);
  cnt_val = unique(vals + 1, vals + cnt_val + 1) - (vals + 1);
  for (int i = 1; i <= cnt; ++i) {
    int j = i;
    while (j + 1 <= cnt && event[j + 1].x == event[i].x) ++j;
    lenx = event[cnt].x - event[j].x;
    for (int k = i; k <= j; ++k) {
      int l = lower_bound(vals + 1, vals + cnt_val + 1, event[k].l) - vals;
      int r = lower_bound(vals + 1, vals + cnt_val + 1, event[k].r + 1) - vals;
      assert(r - l <= K);
      for (int p = l; p < r; ++p) {
        modify(p, event[k].t);
      }
    }
    i = j;
  }
  for (int i = 1; i <= n; ++i) {
    Fastio ::cout << ans[i] << " \n"[i == n];
  }
  return 0;
}