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 = 100005, INF = 2000000000;
struct sl {
  int x, y1, y2, f;
} l[N * 2];
vector<int> row;
int n, m, z, x, y, K;
long long ans[N];
bool cmp1(sl a, sl b) { return a.y1 < b.y1; }
bool cmp2(sl a, sl b) { return a.x < b.x || (a.x == b.x && a.y1 < b.y1); }
int main() {
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &x, &y);
    l[2 * i - 1].x = x;
    l[2 * i - 1].y1 = y - K + 1;
    l[2 * i - 1].y2 = y;
    l[2 * i - 1].f = 1;
    l[2 * i].x = x + K;
    l[2 * i].y1 = y - K + 1;
    l[2 * i].y2 = y;
    l[2 * i].f = -1;
  }
  sort(l + 1, l + 2 * n + 1, cmp1);
  z = -INF;
  for (int i = 1; i <= 2 * n; ++i) {
    for (int j = max(z + 1, l[i].y1); j <= l[i].y2; ++j) row.push_back(j);
    z = l[i].y2;
  }
  sort(l + 1, l + 2 * n + 1, cmp2);
  vector<int> last(row.size(), -INF);
  for (int i = 1; i <= 2 * n; ++i) {
    l[i].y1 = lower_bound(row.begin(), row.end(), l[i].y1) - row.begin();
    l[i].y2 = lower_bound(row.begin(), row.end(), l[i].y2) - row.begin();
  }
  for (int i = 0; i < row.size(); ++i) row[i] = 0;
  for (int i = 1; i <= 2 * n; ++i) {
    for (z = i; z + 1 <= 2 * n && l[z + 1].x == l[i].x; ++z)
      ;
    for (int j = l[i].y1; j <= l[z].y2; ++j) {
      if (row[j] != 0) ans[row[j]] += l[i].x - last[j];
      last[j] = l[i].x;
    }
    for (int p = i; p <= z; ++p)
      for (int j = l[p].y1; j <= l[p].y2; ++j) row[j] += l[p].f;
    i = z;
  }
  for (int i = 1; i <= n; ++i) printf("%I64d ", ans[i]);
}