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;
void solve(int n) {
  int k;
  cin >> k;
  vector<pair<int, int> > pts(n), rpts(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> pts[i].first >> pts[i].second;
    rpts[i] = pair<int, int>(pts[i].second, pts[i].first);
  }
  vector<pair<int, int> > xevs;
  for (int i = 0; i < (int)(n); ++i) {
    xevs.push_back(make_pair(pts[i].first + 1, -i - 1));
    xevs.push_back(make_pair(pts[i].first - k + 1, +i + 1));
  }
  sort((xevs).begin(), (xevs).end());
  vector<long long> cnt(n + 1);
  set<pair<int, int> > alive;
  for (int i = 0; i < (int)((int)(xevs).size() - 1); ++i) {
    int x = xevs[i].first, nx = xevs[i + 1].first;
    vector<pair<int, int> > ps, ms, evs;
    const int id = abs(xevs[i].second) - 1;
    if (xevs[i].second < 0)
      alive.erase(rpts[id]);
    else
      alive.insert(rpts[id]);
    if (x == nx) continue;
    for (const auto &rpr : alive) {
      assert(x <= rpr.second && rpr.second < x + k);
      ps.push_back(make_pair(rpr.first - k + 1, +1));
      ms.push_back(make_pair(rpr.first + 1, -1));
    }
    assert(is_sorted((ps).begin(), (ps).end()));
    assert(is_sorted((ms).begin(), (ms).end()));
    evs.resize((int)(ps).size() + (int)(ms).size());
    merge((ps).begin(), (ps).end(), (ms).begin(), (ms).end(), evs.begin());
    int curcnt = 0;
    for (int j = 0; j < (int)((int)(evs).size() - 1); ++j) {
      int y = evs[j].first, ny = evs[j + 1].first;
      curcnt += evs[j].second;
      assert(0 <= curcnt && curcnt <= n);
      cnt[curcnt] += (long long)(nx - x) * (long long)(ny - y);
    }
    assert(curcnt == (evs.empty() ? 0 : +1));
  }
  for (int i = 0; i < (int)(n + 1); ++i)
    if (i > 0) cout << cnt[i] << " \n"[i == n];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  while (cin >> n) solve(n);
}