#include <bits/stdc++.h>
using namespace std;
int n, m, i, x, y;
vector<pair<int, int> > intr;
vector<int> qq[300011];
long long ans[300011], sum[300011];
long long aib[300011], p;
int zrs(int x) { return (x ^ (x - 1)) & x; }
void add(int pos, int v) {
  while (pos <= m) {
    aib[pos] += v;
    pos += zrs(pos);
  }
}
long long sumi(int pos) {
  long long ans = 0;
  while (pos > 0) {
    ans += aib[pos];
    pos -= zrs(pos);
  }
  return ans;
}
void pre() {
  int i, d, x;
  ans[1] = n;
  for (auto e : intr) sum[e.first]++, sum[e.second + 1]--;
  for (i = 1; i <= m; i++) sum[i] += sum[i - 1];
  for (d = 2; d <= m; d++) {
    for (x = d; x <= m; x += d) {
      ans[d] += sum[x];
      if (x != d) qq[x - d].push_back(d);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    intr.push_back(make_pair(x, y));
  }
  sort(intr.begin(), intr.end());
  pre();
  p = 0;
  for (i = 1; i <= n; i++) {
    while (p < intr.size()) {
      if (intr[p].first > i) break;
      add(intr[p].second, +1);
      p++;
    }
    for (auto e : qq[i]) {
      ans[e] -= p - sumi(i + e - 1);
    }
  }
  for (i = 1; i <= m; i++) printf("%lld\n", ans[i]);
  return 0;
}
