#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 52;
const double pi = acos(-1);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const vector<int> emp;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, -0};
const int DX[8] = {-1, -1, -1, 0, 0, 1, 1, 1},
          DY[8] = {1, 0, -1, 1, -1, 1, 0, -1};
void Divisor(int n, set<int>& s) {
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      s.insert(i);
      if (i != n / i) s.insert(n / i);
    }
  }
}
int n, m;
int main() {
  cin >> n >> m;
  vector<int> a(m + 2);
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    if (r - l <= 10) {
      set<int> st;
      st.insert(1);
      for (int j = l; j <= r; j++) {
        set<int> s;
        Divisor(j, s);
        for (auto it = s.begin(); it != s.end(); it++) st.insert(*it);
      }
      for (auto it = st.begin(); it != st.end(); it++) {
        a[*it]++;
        a[(*it) + 1]--;
      }
    } else {
      a[1]++;
      a[r - l + 2]--;
      int num = 1;
      while (1) {
        int s = (l + num - 1) / num, t = (r + num) / num;
        if (s < r - l + 2) {
          a[r - l + 2]++;
          a[t]--;
          break;
        }
        a[s]++;
        a[t]--;
        num++;
      }
    }
    for (int j = 0; j < m - 2; j++) cout << a[j] << ' ';
    cout << endl;
  }
  for (int i = 1; i < m + 2; i++) a[i] += a[i - 1];
  for (int i = 1; i <= m; i++) cout << a[i] << endl;
}
