#include <bits/stdc++.h>
using namespace std;
template <class T>
bool mini(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool maxi(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
signed main() {
  { ios_base::sync_with_stdio(false), cin.tie(NULL); };
  cout.precision(10);
  cout << fixed;
  int n, m;
  cin >> m >> n;
  vector<pair<int, int> > prs(m);
  for (auto &e : prs) cin >> e.first >> e.second;
  sort((prs).rbegin(), (prs).rend());
  vector<vector<int> > D(n + 1);
  for (int i = 1; i <= (int)(n); i++) {
    D[0].push_back(i);
    for (int j = i; j <= n; j += i) D[j].push_back(i);
  }
  vector<int> bit(n + 1, 0);
  auto up = [&](int i) {
    for (; i <= n; i += i & -i) bit[i]++;
  };
  auto get = [&](int i) {
    int RES = 0;
    for (; i; i -= i & -i) RES += bit[i];
    return RES;
  };
  vector<int> ANS(n + 1, m);
  int cur = 0;
  for (int i = (int)(n)-1; i >= 0; --i) {
    while (cur < m && prs[cur].first > i) {
      up(prs[cur].second);
      cur++;
    }
    for (int v : D[i]) {
      int j = i + v;
      ANS[v] -= get(min(j - 1, n));
    }
  }
  for (int i = 1; i <= (int)(n); i++) cout << ANS[i] << "\n";
}
