#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
template <class... T>
void printl(T&&...) {}
template <class... T>
void printc(T&&...) {}
template <class... T>
void prints(T&&...) {}
template <class... T>
void printd(T&&...) {}
struct SegTree {
  SegTree *l, *r;
  int left, right;
  int value = 0;
  SegTree(int size) : SegTree(0, size - 1) {}
  SegTree(int st, int lt) : left(st), right(lt) {
    if (left == right) {
      l = r = nullptr;
    } else {
      l = new SegTree(left, (right - left) / 2 + left);
      r = new SegTree((right - left) / 2 + left + 1, right);
    }
  }
  void init(vector<double>& data) {
    if (left == right) {
      value = data[left];
    } else {
      l->init(data);
      r->init(data);
    }
  }
  double get(int st, int lt) {
    if (st > lt) {
      return -M;
    }
    if (right < st || lt < left) {
      return -M;
    }
    int lval = l ? l->get(st, lt) : 0, rval = r ? r->get(st, lt) : 0;
    if (lval == -M) {
      lval = 0;
    }
    if (rval == -M) {
      rval = 0;
    }
    return lval + rval + value;
  }
  void add(int st, int lt, int val) {
    if (st > lt) {
      return;
    }
    if (right < st || lt < left) {
      return;
    }
    if (st <= left && right <= lt) {
      value += val;
    } else {
      l->add(st, lt, val);
      r->add(st, lt, val);
    }
  }
};
int main() {
  int n, m;
  cin >> n >> m;
  SegTree st(m);
  vector<int> anss(m);
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    int width = r - l + 1;
    st.add(0, width - 1, 1);
    for (int i = width + 1; i < l; i++) {
      int block = l / i * i, l2 = l - block, r2 = r - block;
      anss[i - 1] += l2 == 0 || r2 >= i;
    }
    st.add(max(width, l - 1), r - 1, 1);
  }
  for (int i = 0; i < m; i++) {
    cout << anss[i] + st.get(i, i) << '\n';
  }
  return 0;
}
