#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e10;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
const int N = 3e5 + 100;
int n, m;
pair<int, int> all[N];
int ans[N];
set<pair<int, int> > has;
vector<int> d[N];
namespace BIT {
int num[N];
inline int lowbit(const int &i) { return i & (-i); }
inline void modify(int i, const int &x) {
  for (; i <= m; i += lowbit(i)) num[i] += x;
  return;
}
inline int query(int i) {
  int ret = 0;
  for (; i; i ^= lowbit(i)) ret += num[i];
  return ret;
}
}  // namespace BIT
inline void get_fac(int n) {
  ;
  for (int i = 1; i * i <= n; ++i)
    if (n % i == 0) {
      d[n].push_back(i);
      if (i * i != n) d[n].push_back(n / i);
    }
  return;
}
inline void add(const int &i) {
  int &l = all[i].first, &r = all[i].second;
  return BIT::modify(l, 1);
}
inline void del(const int &i) {
  int &l = all[i].first, &r = all[i].second;
  return BIT::modify(l, -1);
}
int main() {
  scf(n, m);
  for (int i = 0; i < (n); i++) {
    int l, r;
    scf(l, r);
    all[i] = make_pair(l, r);
  }
  sort(all, all + n);
  for (int i = (1); i <= (m); i++) get_fac(i);
  int I = 0;
  for (int i = (1); i <= (m); i++) {
    while (I < n && all[I].first <= i)
      add(I), has.insert({all[I].second, I}), I++;
    while ((int)has.size() && has.begin()->first < i)
      del(has.begin()->second), has.erase(has.begin());
    for (auto j : d[i]) {
      ;
      ;
      ans[j] += BIT::query(i) - BIT::query(i - j);
    }
  }
  for (int i = (1); i <= (m); i++) printf("%d\n", ans[i]);
  return 0;
}
