#include <bits/stdc++.h>
using namespace std;
set<int> divisor(long long n) {
  set<int> ret;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      ret.insert(i);
      if (i != n / i) ret.insert(n / i);
    }
  }
  return ret;
}
template <class T>
class segtree {
 private:
  vector<T> dat;
  int _size;
  T _init;

 public:
  segtree(int __size = 0, T init = numeric_limits<T>::max())
      : _size(__size), _init(init), dat(4 * __size, init) {
    if (__size == 0) return;
    int x = 1;
    while (x < _size) x *= 2;
    _size = x;
    for (int i = 1; i <= 100000; i++) {
      dat[_size + i] = divisor(i);
    }
    for (int i = _size - 1; i >= 1; i--) {
      if (dat[2 * i].size() > dat[2 * i + 1].size()) {
        dat[i] = dat[2 * i];
        for (auto e : dat[2 * i + 1]) dat[i].insert(e);
      } else {
        dat[i] = dat[2 * i + 1];
        for (auto e : dat[2 * i]) dat[i].insert(e);
      }
    }
  }
  T find(int s, int t, int num = 1, int a = 0, int b = -1) {
    if (b == -1) b = _size - 1;
    if (b < s || t < a) return _init;
    if (s <= a && b <= t) return dat[num];
    set<int> res1 = find(s, t, num * 2, a, (a + b) / 2);
    set<int> res2 = find(s, t, num * 2 + 1, (a + b) / 2 + 1, b);
    if (res1.size() < res2.size()) {
      for (auto e : res1) res2.insert(e);
      return res2;
    } else {
      for (auto e : res2) res1.insert(e);
      return res1;
    }
  }
  int size() { return _size; }
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v(n);
  for (long long i = 0; i < (long long)(n); i++) {
    scanf("%d %d", &v[i].first, &v[i].second);
  }
  segtree<set<int>> x(100001);
  vector<int> ans(100001, 0);
  for (long long i = 0; i < (long long)(v.size()); i++) {
    set<int> res = x.find(v[i].first, v[i].second);
    for (auto e : res) {
      ans[e]++;
    }
  }
  for (int i = 1; i <= m; i++) {
    printf("%d\n", ans[i]);
  }
}
