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 int N = 4e5 + 10, INF = 2e9;
int cnt[N], cnt2[N], x[N], y[N], hv[N];
long long ans[N];
vector<pair<int, int> > row[N];
set<int> st;
map<pair<int, int>, int> mp;
template <typename T>
void unq(vector<T> &v) {
  sort(v.begin(), v.end());
  v.resize(distance(v.begin(), unique(v.begin(), v.end())));
}
void del(int d, int cur) {
  hv[d]--;
  cnt[d] -= cur;
  if (!hv[d]) st.erase(d);
}
void add(int d, int cur) {
  if (!hv[d]) st.insert(d);
  hv[d]++;
  cnt[d] += cur;
  cnt2[d] += cur;
}
int arr[N];
int fnd(int d, vector<int> &v) {
  return lower_bound(v.begin(), v.end(), d) - v.begin();
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> xs, ys;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    xs.push_back(x[i]);
    xs.push_back(x[i] - k + 1);
    ys.push_back(y[i]);
    ys.push_back(y[i] - k + 1);
  }
  unq(xs);
  unq(ys);
  for (int i = 0; i < n; i++) {
    int ix = fnd(x[i], xs);
    int ix2 = fnd(x[i] - k + 1, xs);
    int iy = fnd(y[i], ys);
    int iy2 = fnd(y[i] - k + 1, ys);
    row[iy].push_back(pair<int, int>(ix, 1));
    row[iy].push_back(pair<int, int>(ix2, 0));
    row[iy2].push_back(pair<int, int>(ix, 0));
    row[iy2].push_back(pair<int, int>(ix2, 0));
  }
  for (int i = 0; i < ys.size(); i++) unq(row[i]);
  int m = ys.size(), las = INF;
  int id = m - 1;
  for (int i = m - 1; i >= 0; i--) {
    while (ys[id] - ys[i] > k - 1) {
      for (auto j : row[id]) del(j.first, j.second);
      id--;
    }
    for (auto j : row[i]) {
      add(j.first, j.second);
    }
    int cur = 0, cur2 = 0;
    int r = 0;
    auto wow = st.begin();
    for (int i = 0; i < st.size(); i++) {
      arr[i] = *wow;
      wow++;
    }
    for (int l = 0; l < st.size(); l++) {
      int XX = arr[l];
      while (r < st.size() && (xs[arr[r]] - xs[XX] + 1) <= k) {
        cur += cnt[arr[r]];
        cur2 += cnt2[arr[r]];
        r++;
      }
      ans[cur]++;
      if (l < st.size() - 1) {
        ans[cur - cnt[XX]] += (xs[arr[l + 1]] - xs[XX] - 1);
      }
      if (i < m - 1) ans[cur - cur2] += (ys[i + 1] - ys[i] - 1);
      if (i < m - 1 && l < st.size() - 1)
        ans[cur - cur2 - cnt[XX] + cnt2[XX]] +=
            (xs[arr[l + 1]] - xs[XX] - 1) * 1LL * (ys[i + 1] - ys[i] - 1);
      cur2 -= cnt2[XX];
      cur -= cnt[XX];
    }
    for (auto j : row[i]) cnt2[j.first] = 0;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " \n"[i == n];
  return 0;
}