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>
template <class InputIt, class BinaryOperation>
InputIt consecutive_pairs(InputIt first, InputIt last,
                          BinaryOperation binary_operation) {
  if (first != last) {
    InputIt second = std::next(first);
    if (second != last) {
      do {
        binary_operation(*first++, *second++);
      } while (second != last);
      return first;
    }
  }
  return last;
}
struct Data {
  std::vector<std::pair<int, int> > points;
  int square_size;
  void Solve() const {
    std::vector<std::tuple<int, int, bool> > events_x;
    events_x.reserve(2 * points.size());
    for (auto const &p : points) {
      events_x.push_back(std::tuple<int, int, bool>{p.first, p.second, true});
      events_x.push_back(
          std::tuple<int, int, bool>{p.first + square_size, p.second, false});
    }
    std::sort(events_x.begin(), events_x.end());
    std::map<std::pair<int, bool>, int> events_y;
    std::vector<std::int64_t> count;
    count.resize(points.size());
    consecutive_pairs(
        events_x.cbegin(), events_x.cend(),
        [&](std::tuple<int, int, bool> const &ax,
            std::tuple<int, int, bool> const &bx) {
          {
            std::pair<int, bool> const add_event{std::get<1>(ax), true};
            std::pair<int, bool> const remove_event{
                std::get<1>(ax) + square_size, false};
            if (std::get<2>(ax)) {
              ++events_y[add_event];
              ++events_y[remove_event];
            } else {
              auto const remove_from_map =
                  [&events_y](std::pair<int, bool> const &event) {
                    auto const it = events_y.find(event);
                    if (it != events_y.end()) {
                      --it->second;
                      if (it->second == 0) {
                        events_y.erase(it);
                      }
                    }
                  };
              remove_from_map(add_event);
              remove_from_map(remove_event);
            }
          }
          int const distance_x = std::get<0>(bx) - std::get<0>(ax);
          if (distance_x == 0) {
            return;
          }
          std::int64_t overlapping = 0;
          consecutive_pairs(
              events_y.cbegin(), events_y.cend(),
              [&](std::pair<std::pair<int, bool>, int> const &a,
                  std::pair<std::pair<int, bool>, int> const &b) {
                if (a.first.second) {
                  overlapping += a.second;
                } else {
                  overlapping -= a.second;
                }
                int const distance_y = b.first.first - a.first.first;
                if (distance_y == 0) {
                  return;
                }
                if (overlapping > 0) {
                  count[overlapping - 1] += distance_x * distance_y;
                }
              });
        });
    for (auto c : count) {
      std::cout << c << " ";
    }
  }
};
std::ostream &operator<<(std::ostream &os, Data const &data) {
  os << data.points.size() << " " << data.square_size << "\n";
  for (auto const &p : data.points) {
    os << p.first << " " << p.second << "\n";
  }
  return os;
}
std::istream &operator>>(std::istream &is, Data &data) {
  std::size_t n;
  is >> n >> data.square_size;
  data.points.resize(n);
  for (auto &p : data.points) {
    is >> p.first >> p.second;
  }
  return is;
}
struct Tests {
  void DescribeTest(std::ostream &out, int index, bool input) const {
    if (index == 0) {
      if (input) {
        Data const data = {{{0, 0}}, 5};
        std::cout << data;
      } else {
        std::cout << "25 ";
      }
    } else if (index == 1) {
      if (input) {
        Data const data = {{{4, 5}, {4, 6}, {5, 5}, {5, 6}, {7, 7}}, 3};
        std::cout << data;
      } else {
        std::cout << "10 8 1 4 0 ";
      }
    } else if (index == 2) {
      std::int64_t const n = 100000;
      int const square_size = 300;
      if (input) {
        Data data;
        data.square_size = square_size;
        for (int i = 0; i < n; ++i) {
          data.points.push_back({0, 2 * i * square_size});
        }
        std::cout << data;
      } else {
        std::cout << n * square_size * square_size << " ";
        for (int i = 1; i < n; ++i) {
          std::cout << "0 ";
        }
      }
    }
  }
  int Size() const { return 3; }
};
int main(int argc, char *argv[]) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  Data input;
  std::cin >> input;
  input.Solve();
  return 0;
}