#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const int INF = 1001001001;
const ll mod = 1e+9 + 7;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

template<typename Monoid, typename OperatorMonoid = Monoid>
struct LazySegmentTree{
    using F = function<Monoid(Monoid, Monoid)>;
    using G = function<Monoid(Monoid, OperatorMonoid)>;
    using H = function<OperatorMonoid(OperatorMonoid, OperatorMonoid)>;
    using C = function<OperatorMonoid(OperatorMonoid, int)>;

    int sz;
    vector<Monoid> data;
    vector<OperatorMonoid> lazy;
    const F f;
    const G g;
    const H h;
    const Monoid M1;            // モノイドの単位元
    const OperatorMonoid OM0;   // 作用素モノイドの単位元
    const C c;

    LazySegmentTree(int n, const F f, const G g, const H h, const Monoid &M1,
        const OperatorMonoid OM0, const C c = [](int a, int b){return a;})
        : f(f), g(g), h(h), M1(M1), OM0(OM0), c(c)
    {
        sz = 1;
        while(sz < n)   sz <<= 1;
        data.assign(sz << 1, M1);
        lazy.assign(sz << 1, OM0);
    }

    void set(int k, const Monoid &x){
        data[k + sz] = x;
    }

    void build(){
        for(int k = sz - 1; k > 0; --k){
            data[k] = f(data[k << 1], data[k << 1 | 1]);
        }
    }

    void propagate(int k, int len){
        if(lazy[k] != OM0){
            if(k < sz){
                lazy[k << 1] = h(lazy[k << 1], lazy[k]);
                lazy[k << 1 | 1] = h(lazy[k << 1 | 1], lazy[k]);
            }
            data[k] = g(data[k], c(lazy[k], len));
            lazy[k] = OM0;
        }
    }

    // a,b : 実際の配列上の index
    // k : セグ木上の index
    // l,r : data[k] が実際の配列でのどの区間の両端か (半開区間 [l,r) )
    Monoid update(int a, int b, const OperatorMonoid &x, int k=1, int l=0, int r=-1){
        if(r == -1)     r = sz;
        propagate(k, r - l);
        if(r <= a || b <= l)    return data[k];
        else if(a <= l && r <= b){
            lazy[k] = h(lazy[k], x);
            propagate(k, r - l);
            return data[k];
        }
        else{
            return data[k] = f(update(a, b, x, k << 1, l, (l + r) >> 1),
                                update(a, b, x, k << 1 | 1, (l + r) >> 1, r));
        }
    }

    Monoid query(int a, int b, int k=1, int l=0, int r=-1){
        if(r == -1)     r = sz;
        propagate(k, r - l);
        if(r <= a || b <= l)    return M1;
        else if(a <= l && r <= b)   return data[k];
        else{
            return f(query(a, b, k << 1, l, (l + r) >> 1),
                        query(a, b, k << 1 | 1, (l + r) >> 1, r));
        }
    }

    Monoid operator[](const int &k){
        return query(k, k + 1);
    }

    void print(){
        for(int i = 0; i < data.size(); ++i){
            cerr << data[i] << " ";
        }
        cerr << "\n";
    }
};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, m;
    cin >> n >> m;
    vector<P> input(n);
    for(int i = 0; i < n; ++i){
        int l, r;
        cin >> l >> r;
        ++r;
        input[i] = P(l, r);
    }
    sort(input.begin(), input.end(), [&](P p1, P p2){return p1.second - p1.first < p2.second - p2.first;});
    LazySegmentTree<int, int> seg(m+5, [](int a, int b){return a + b;},
                                        [](int a, int b){return a + b;},
                                        [](int a, int b){return a + b;},
                                        0, 0,
                                        [](int a, int b){return a * b;});

    int pos = 0;
    for(int d = 1; d <= m; ++d){
        while(pos < n && input[pos].second - input[pos].first < d){
            seg.update(input[pos].first, input[pos].second, 1);
            ++pos;
        }
        int res = 0;
        for(int i = d; i <= m; i += d)  res += seg.query(i, i + 1);
        res += n - pos;
        cout << res << "\n";
    }
}

Measured memory_bytes: 6912