#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long mod2 = 998244353;
long long inf = 1000000000000000000;
double pi = 2 * acos(0);
int dh[4] = {1, -1, 0, 0};
int dw[4] = {0, 0, 1, -1};
int ddh[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int ddw[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
long long lmax(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long lmin(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
long long Pow(long long n, long long k) {
  long long ret = 1;
  long long now = n;
  while (k > 0) {
    if (k & 1) ret *= now;
    now *= now;
    k /= 2;
  }
  return ret;
}
long long gya[200010];
long long kai[200010];
long long m;
long long beki(long long n, long long k) {
  long long ret = 1;
  long long now = n;
  while (k > 0) {
    if (k % 2 == 1) {
      ret *= now;
      ret %= m;
    }
    now *= now;
    now %= m;
    k /= 2;
  }
  return ret;
}
long long gyaku(long long n) { return beki(n, mod - 2); }
void nckinit(long long n) {
  kai[0] = 1;
  kai[1] = 1;
  for (int i = 2; i <= n; i++) {
    kai[i] = kai[i - 1] * i;
    kai[i] %= mod;
  }
  gya[n] = gyaku(kai[n]);
  for (int i = n - 1; i >= 1; i--) {
    gya[i] = gya[i + 1] * (i + 1);
    gya[i] %= mod;
  }
  gya[0] = 1;
}
long long nck(long long n, long long k) {
  if (k < 0) return 0;
  if (k == 0 || n == k) return 1;
  long long ret = kai[n];
  ret *= gya[n - k];
  ret %= mod;
  ret *= gya[k];
  ret %= mod;
  return ret;
}
long long npk(long long n, long long k) {
  if (k < 0) return 0;
  if (k == 0) return 1;
  long long ret = kai[n];
  ret *= gya[n - k];
  ret %= mod;
  return ret;
}
random_device rnd;
mt19937 mt(rnd());
uniform_real_distribution<double> ra(1, 6);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int imos[m + 2];
  fill(imos, imos + m + 2, 0);
  for (long long i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    int num = 1;
    for (;;) {
      if (num * num > l) break;
      int lr = l / num;
      int rr = r / num;
      if (lr == rr && lr % num != 0 && rr % num != 0) {
        imos[num]++;
        imos[num + 1]--;
      }
      num++;
    }
    for (long long j = l / num; j >= 1; j--) {
      int a = l / (j + 1) + 1;
      int b = l / j;
      if (l % j == 0) b--;
      int c = r / (j + 1) + 1;
      int d = r / j;
      if (r % j == 0) d--;
      if (b < c) continue;
      if (a > b) continue;
      if (c > d) continue;
      imos[c]++;
      imos[b + 1]--;
    }
    imos[r + 1]++;
  }
  for (long long i = 1; i < m + 1; i++) {
    imos[i] += imos[i - 1];
    cout << n - imos[i] << endl;
  }
}
