// Slower C++ solution:
#include<bits/stdc++.h>

#define st first

#define nd second

#define pb push_back

#define pf push_front

#define ppb pop_back

#define ppf pop_front

#define umax(x,y) x=max(x,y)

#define umin(x,y) x=min(x,y)

#define ll long long

#define ii pair<int,int>

#define iii pair<int,ii>

#define iiii pair<ii,ii>

#define sz(x) ((int) x.size())

#define orta ((bas+son)/2)

#define all(x) x.begin(),x.end()

#define inf 1000000000

#define MOD 1000000007 

#define N 100005

#define M 1000000

#define LOG 20

#define KOK 300

#define EPS 0.0000001

using namespace std;



int n,m;

int ans[N];

int f[N<<1];

vector<ii> v[N<<1];



int get(int x) {



	int res=0;



	for(int i=x;i>=1;i-=i&-i) res+=f[i];



	return res;



}



void up(int x) {



	for(int i=x;i<=m+m;i+=i&-i) f[i]++;



}



int main() {



	scanf("%d %d",&n,&m);



	for(int i=1;i<=n;i++) {



		int l,r;



		scanf("%d %d",&l,&r);



		v[r].pb({l,1});



	}



	for(int i=1;i<=m;i++) {



		for(int j=i;j<=m+m;j+=i) {



			v[j].pb({j-i,0});



		}



	}



	for(int i=1;i<=m+m;i++) {



		sort(all(v[i]),[](ii a,ii b){return a.nd<b.nd;});



		for(auto x:v[i]) {



			if(x.nd) {



				up(x.st);



			}

			else {



				ans[i-x.st]+=get(i-1)-get(x.st);



			}



		}



	}



	for(int i=1;i<=m;i++) printf("%d\n",n-ans[i]);



}	

// Faster C++ solution for the same problem (measured speedup: 6.3440092775109695x):
#include <bits/stdc++.h>



using namespace std;



const int MaxN = 300005;



struct SegmentTree

{

    vector<int> Val, Low, High, Leaf;

    void Build(int x, int Left, int Right)

    {

        Low[x] = Left;

        High[x] = Right;

        if (Left == Right)

        {

            Leaf[Left] = x;

            return;

        }

        int Mid = (Left + Right) / 2;

        Build(x * 2, Left, Mid);

        Build(x * 2 + 1, Mid + 1, Right);

    }

    void Update(int x, int Left, int Right, int val)

    {

        if(Low[x] > Right || High[x] < Left)

        {

            return;

        }

        if (Low[x] >= Left && High[x] <= Right)

        {

            Val[x] += val;

            return;

        }

        Update(x * 2, Left, Right, val);

        Update(x * 2 + 1, Left, Right, val);

    }

    int Get(int x)

    {

        x = Leaf[x];

        int Resuft = 0;

        while (x > 0)

        {

            Resuft += Val[x];

            x /= 2;

        }

        return Resuft;

    }

    void Init(int n)

    {

        Val.assign(n * 4 + 5, 0);

        Low.assign(n * 4 + 5, 0);

        High.assign(n * 4 + 5, 0);

        Leaf.assign(n + 5, 0);

        Build(1, 1, n);

    }

};



int n, m;

pair<int, int> a[MaxN];

int Resuft[MaxN];

SegmentTree ST;



bool cmp(pair<int, int> x, pair<int, int> y)

{

    return (x.second - x.first) > (y.second - y.first);

}



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    cin >> n >> m;

    for (int i = 1; i <= n; i++)

    {

        cin >> a[i].first >> a[i].second;

    }

    ST.Init(m);

    sort(a + 1, a + n + 1, cmp);

    int j = n;

    Resuft[1] = n;

    for (int i = 2; i <= m; i++)

    {

        while (a[j].second - a[j].first + 1 < i && j >= 1)

        {

            ST.Update(1, a[j].first, a[j].second, 1);

            j--;

        }

        Resuft[i] = j;

        for (int k = i; k <= m; k += i)

        {

            Resuft[i] += ST.Get(k);

        }

    }

    for (int i = 1; i <= m; i++)

    {

        cout << Resuft[i] << '\n';

    }

    

    return 0;

}