#define LOCAL

#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <iomanip>

using namespace std;

// From Errichto's Youtube stream
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using int64 = long long;

/////////////////////
// Code starts here//
/////////////////////

int N, M;
vector<pair<int, int>> events;
vector<vector<int>> opens;
vector<vector<int>> trains;
vector<int> result;
vector<int> last_seen;

struct FenwickTree {
    vector<int> bit;  // binary indexed tree
    int n;

    FenwickTree(int n) {
        this->n = n;
        bit.assign(n, 0);
    }

    FenwickTree(vector<int> a) : FenwickTree(a.size()) {
        for (size_t i = 0; i < a.size(); i++)
            add(i, a[i]);
    }

    int sum(int r) {
        int ret = 0;
        for (; r >= 0; r = (r & (r + 1)) - 1)
            ret += bit[r];
        return ret;
    }

    int sum(int l, int r) {
        return sum(r) - sum(l - 1);
    }

    void add(int idx, int delta) {
        for (; idx < n; idx = idx | (idx + 1))
            bit[idx] += delta;
    }
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> M >> N;

    opens.resize(N + 2);
    for (int i = 0; i < M; i++) {
        int l, r;
        cin >> l >> r;
        opens[r].push_back(l);
    }

    trains.resize(N + 1);
    for (int i = 2; i <= N; i++) {
        for (int j = i; j <= N; j += i) {
            trains[j].push_back(i);
        }
    }

    result.assign(N + 1, M);
    FenwickTree bit(N + 1);

    last_seen.resize(N + 1);

    result[1] = M;
    for (int i = 1; i <= N; i++) {
        //debug() << "i: " << i;
        for (auto t : trains[i]) {
            last_seen[t] = i;
            //debug() << t << " from " << i - t + 1 << " to " << i - 1;
            result[t] -= bit.sum(i - t + 1, i - 1);
        }

        for (auto l : opens[i]) {
            bit.add(l, 1);
        }
    }

    //debug() << "? " << bit.sum(3, 3);

    for (int i = 2; i <= N; i++) {
        //debug() << i << " " << last_seen[i];
        result[i] -= bit.sum(last_seen[i] + 1, N);
    }

    for (int i = 1; i <= N; i++)
        cout << result[i] << "\n";

    return 0;
}


Measured memory_bytes: 17536