#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
inline bool chmin(T& x, U y) {
  if (x > y) {
    x = y;
    return true;
  }
  return false;
}
template <class T, class U>
inline bool chmax(T& x, U y) {
  if (x < y) {
    x = y;
    return true;
  }
  return false;
}
vector<pair<int, int>> Q;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  Q.reserve(2 * n + 3 * m);
  Q.resize(2 * n);
  for (int i = 0; i < (n); ++i) {
    cin >> Q[i].first >> Q[n + i].first;
    Q[i].second = -i;
    Q[n + i].second = m + 1 + i;
  }
  for (int i = 1; i <= (m); ++i)
    for (int j = i; j <= m; j += i) Q.emplace_back(j, i);
  sort(Q.begin(), Q.end());
  vector<bitset<100000>> ans(m);
  bitset<100000> s{};
  for (auto& q : Q) {
    if (q.second <= 0)
      s[-q.second] = true;
    else if (q.second > m)
      s[q.second - m - 1] = false;
    else
      ans[q.second - 1] |= s;
  }
  for (const auto& i : ans) cout << i.count() << '\n';
}
