#include <bits/stdc++.h>
const int MAXN = 300000 + 10;
int N, M;
struct node {
  int l, r, x;
} A[MAXN];
int cnt[MAXN];
int tree[MAXN << 2];
inline bool operator<(node x, node y) {
  return x.x != y.x ? y.x < x.x : x.l != y.l ? x.l < y.l : x.r < y.r;
}
inline void update(int rt, int l, int r, int x, int y, int d) {
  if (x <= l && r <= y) return void(tree[rt] += d);
  if (r < x || y < l) return void();
  int mid = (l + r) >> 1;
  if (x <= mid) update(rt << 1, l, mid, x, y, d);
  if (mid < y) update(rt << 1 | 1, mid + 1, r, x, y, d);
}
inline int query(int rt, int l, int r, int x) {
  if (l == x && l == r) return tree[rt];
  if (r < x || x < l) return 0;
  int mid = (l + r) >> 1, res = 0;
  if (x <= mid)
    res += query(rt << 1, l, mid, x);
  else
    res += query(rt << 1 | 1, mid + 1, r, x);
  res += tree[rt];
  return res;
}
int main() {
  register int i, j;
  int tail;
  scanf("%d%d", &N, &M);
  if (N <= 2000) {
    for (i = 1; i <= N; ++i) {
      scanf("%d%d", &A[i].l, &A[i].r);
      for (j = 1; j <= A[i].r; ++j)
        if (A[i].l / j < A[i].r / j || A[i].l % j == 0 || A[i].r % j == 0)
          ++cnt[j];
    }
    for (i = 1; i <= M; ++i) printf("%d\n", cnt[i]);
  }
  for (i = 1; i <= N; ++i)
    scanf("%d%d", &A[i].l, &A[i].r), A[i].x = A[i].r - A[i].l + 1,
                                     update(1, 0, M, A[i].l, A[i].r, 1);
  std::sort(A + 1, A + N + 1);
  tail = 0;
  for (i = M; i; --i) {
    while (tail < N && A[tail + 1].x >= i)
      ++tail, update(1, 0, M, A[tail].l, A[tail].r, -1);
    cnt[i] = tail;
    for (j = 0; j <= M; j += i) cnt[i] += query(1, 0, M, j);
  }
  for (i = 1; i <= M; ++i) printf("%d\n", cnt[i]);
  return 0;
}
