#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
  for (auto& x : v) o << x << ' ';
  return o;
}
vector<pair<int, int> > inter;
class SegmentTree {
 private:
  int n;
  vector<int> arr, st;
  int merge(int p1, int L1, int R1, int p2, int L2, int R2) {
    int res = p1 + p2;
    int lb = int(
        lower_bound(inter.begin(), inter.end(), pair<int, int>(L1, INT_MIN)) -
        inter.begin());
    int ub = int(
        upper_bound(inter.begin(), inter.end(), pair<int, int>(R1, INT_MAX)) -
        inter.begin());
    for (int i = lb; i < ub; i++) {
      if (inter[i].second <= R2 && inter[i].second >= L2) res++;
    }
    return res;
  }
  void build(int p, int L, int R) {
    if (L == R)
      st[p] = arr[L];
    else {
      int mid = (L + R) / 2;
      build(p * 2, L, mid);
      build(p * 2 + 1, mid + 1, R);
      st[p] = merge(st[p * 2], L, mid, st[p * 2 + 1], mid + 1, R);
    }
  }
  int query(int p, int L, int R, int i, int j) {
    if (i > R || j < L) return 0;
    if (i <= L && j >= R) return st[p];
    int mid = (L + R) / 2;
    if (j <= mid) return query(p * 2, L, mid, i, j);
    if (i > mid) return query(p * 2 + 1, mid + 1, R, i, j);
    int p1 = query(p * 2, L, mid, i, j);
    int p2 = query(p * 2 + 1, mid + 1, R, i, j);
    return merge(p1, max(L, i), mid, p2, mid + 1, min(R, j));
  }

 public:
  SegmentTree(int n, const vector<int>& arr) : n(n), arr(arr) {
    st.assign(4 * n, 0);
    build(1, 0, n - 1);
  }
  int query(int i, int j) { return query(1, 0, n - 1, i, j); }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> arr(m + 1, 0);
  inter.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> inter[i].first >> inter[i].second;
    if (inter[i].first == inter[i].second) arr[inter[i].first]++;
  }
  sort(inter.begin(), inter.end());
  SegmentTree stree(m + 1, arr);
  for (int i = 1; i <= m; i++) {
    int j;
    int res = n;
    for (j = i; j <= m; j += i) {
      res -= stree.query(j - i + 1, j - 1);
    }
    res -= stree.query(j - i + 1, m);
    cout << res << "\n";
  }
}
