#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct BinaryIndexedTree {
  vector<T> data;
  BinaryIndexedTree(long long sz) { data.assign(++sz, 0); }
  T sum(long long k) {
    T ret = 0;
    for (++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }
  void add(long long k, T x) {
    for (++k; k < data.size(); k += k & -k) data[k] += x;
  }
};
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> ans(m);
  vector<vector<long long>> q(m + 2);
  vector<vector<long long>> f(m + 1);
  BinaryIndexedTree<long long> b(m + 1);
  for (long long i = 0; i < (long long)(n); i++) {
    long long l, r;
    cin >> l >> r;
    q[l].push_back(l);
    q[r + 1].push_back(-l);
  }
  for (long long i = 1; i <= m; i++) {
    for (long long j = i; j <= m; j += i) {
      f[j].push_back(i);
    }
  }
  for (long long i = 1; i <= m; i++) {
    for (auto t : q[i]) {
      if (t > 0)
        b.add(t, 1);
      else
        b.add(-t, -1);
    }
    for (auto t : f[i]) {
      ans[t - 1] += b.sum(i) - b.sum(i - t);
      cout << b.sum(i) << " " << b.sum(i - t) << endl;
    }
  }
  for (auto an : ans) cout << an << endl;
  return 0;
}
