stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>

#include <vector>

#include <map>

#include <cstdlib>

#include <set>

#include <stack>

#include <queue>

using namespace std;



#define X first

#define Y second

#define N 300010

#define M 400010

typedef long long ll;

typedef pair<int,int> pii;

const int Mod=1000000007;



int n,m;

int c[N];

vector<pii> g[N];



inline int Lowbit(int x){return x&(-x);}



void Add(int x,int v)

{

	while (x<=m)

	{

		c[x]+=v;

		x+=Lowbit(x);

	}

}



int Val(int x)

{

	int res=0;

	while (x)

	{

		res+=c[x];

		x-=Lowbit(x);

	}

	return res;

}



int main()

{

	//freopen("in.in","r",stdin);

	//freopen("out.out","w",stdout);

	

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

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

	{

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

		g[r-l+1].push_back(make_pair(l,r));

	}

	int sz=0;

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

	{

		int x=i,res=0;

		do

		{

			res+=Val(x);

			x+=i;

		}while (x<=m);

		

		for (int j=0;j<g[i].size();j++)

		{

			Add(g[i][j].X,1);

			Add(g[i][j].Y+1,-1);

		}

		printf("%d\n",res+n-sz);

		sz+=g[i].size();

	}

	return 0;

}


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



using namespace std;



struct Range

{

	int l,r,sz;

	Range(){}

}R[300001];



bool operator < (const Range &a, const Range &b)

{

	return a.sz < b.sz;

}



int n,m;

int ans[100011];

int Tree[100011];



void update(int x,int val)

{

	for(;x<=100010;x+=x&(-x))

		Tree[x] += val;

}



int query(int x)

{

	int ans = 0;

	for(;x>0;x-=x&(-x))

		ans += Tree[x];

	return ans;	

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);



	cin >> n >> m;

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

	{

		cin >> R[i].l >> R[i].r;

		R[i].sz = (R[i].r - R[i].l + 1);

	}	

	sort(R+1,R+1+n);

	int pos = 1;

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

	{

		while(pos <= n && R[pos].sz < i)

		{

			update(R[pos].l,1);

			update(R[pos].r+1,-1);

			pos++;

		}

		ans[i] = (n - pos + 1);

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

			ans[i] += query(j);

	}	

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

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

}
// Slower C++ solution:
#include<set>

#include<map>

#include<stack>

#include<queue>

#include<deque>

#include<cmath>

#include<cstdio>

#include<cctype>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<sstream>

#include<iostream>

#include<algorithm>

#define MAXN 300000

#define MAXM 100000

#define lowbit(x) (x&(-x))



using namespace std;



int n,m;

vector<int>gg[MAXM+80];

struct node{

	int a[MAXM+80];

	void add(int x,int A)

	{

		while(x<=m)

		{

			a[x]+=A;

			x+=lowbit(x);

		}

		return ;

	}

	int S(int x)

	{

		int sum=0;

		while(x)

		{

			sum+=a[x];

			x-=lowbit(x);

		}

		return sum;

	}

}tree;

int main()//You'll know it's a copy.

{

	int i,j,l,r,tmp=0,S;

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

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

	{

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

		gg[r-l+1].push_back(l);

	}

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

	{

		S=0;

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

			S+=tree.S(j);

		for(j=0;j<gg[i].size();j++)

			tree.add(gg[i][j],-1),tree.add(i+gg[i][j],1);

		printf("%d\n",n-tmp-S);

		tmp+=gg[i].size();

	}

	return 0;

}

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



using namespace std;



struct Range

{

	int l,r,sz;

	Range(){}

}R[300001];



bool operator < (const Range &a, const Range &b)

{

	return a.sz < b.sz;

}



int n,m;

int ans[100011];

int Tree[100011];



void update(int x,int val)

{

	for(;x<=100010;x+=x&(-x))

		Tree[x] += val;

}



int query(int x)

{

	int ans = 0;

	for(;x>0;x-=x&(-x))

		ans += Tree[x];

	return ans;	

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);



	cin >> n >> m;

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

	{

		cin >> R[i].l >> R[i].r;

		R[i].sz = (R[i].r - R[i].l + 1);

	}	

	sort(R+1,R+1+n);

	int pos = 1;

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

	{

		while(pos <= n && R[pos].sz < i)

		{

			update(R[pos].l,1);

			update(R[pos].r+1,-1);

			pos++;

		}

		ans[i] = (n - pos + 1);

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

			ans[i] += query(j);

	}	

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

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

}
// Slower C++ solution:
//============================================================================

// Name        : test.cpp

// Author      : Qihan

// Version     :

// Copyright   : Your copyright notice

// Description : Hello World in C++, Ansi-style

//============================================================================



#include <bits/stdc++.h>

#define Lowbit(x) (x & (-x))

using namespace std;

typedef long long int LLI;

typedef pair<int,int> PII;

const int maxn = (300000 + 10);



struct Seg{

	int l,r,len;

}op[maxn];



bool cmp(Seg a,Seg b){

	return a.len < b.len;

}



int c[maxn];



void add(int x,int change,int n){

	while(x < n){

		c[x] += change;

		x += Lowbit(x);

	}

}



int sum(int x){

	int ans = 0;

	while(x > 0){

		ans += c[x];

		x -= Lowbit(x);

	}

	return ans;

}



int main(){

//	freopen("/home/qihan/Documents/in","r",stdin);

	int n,m;

	memset(c,0,sizeof(c));

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

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

		scanf("%d%d",&op[i].l,&op[i].r);

		op[i].len = op[i].r - op[i].l + 1;

	}

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

	int k = 1;

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

		for(;k <= n && op[k].len < i;k ++){

			add(op[k].l,1,300000);

			add(op[k].r + 1,-1,300000);

		}

		int ans = n - k + 1;

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

			ans += sum(j);

		}

		printf("%d\n",ans);

	}

	return 0;

}


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



using namespace std;



struct Range

{

	int l,r,sz;

	Range(){}

}R[300001];



bool operator < (const Range &a, const Range &b)

{

	return a.sz < b.sz;

}



int n,m;

int ans[100011];

int Tree[100011];



void update(int x,int val)

{

	for(;x<=100010;x+=x&(-x))

		Tree[x] += val;

}



int query(int x)

{

	int ans = 0;

	for(;x>0;x-=x&(-x))

		ans += Tree[x];

	return ans;	

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);



	cin >> n >> m;

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

	{

		cin >> R[i].l >> R[i].r;

		R[i].sz = (R[i].r - R[i].l + 1);

	}	

	sort(R+1,R+1+n);

	int pos = 1;

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

	{

		while(pos <= n && R[pos].sz < i)

		{

			update(R[pos].l,1);

			update(R[pos].r+1,-1);

			pos++;

		}

		ans[i] = (n - pos + 1);

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

			ans[i] += query(j);

	}	

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

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

}
// Slower C++ solution:
//### In The Name Of GOD ###



//%% Remember; (((He))) is The (((Accepter))) %%



// GOD IS GREATER ...



#include <bits/stdc++.h>



using namespace std;



typedef long long ll ;

typedef long double ld ;



#define int ll

#define pb push_back

#define bp pop_back

#define pf push_front

#define fp pop_front

#define X first

#define Y second

#define IO ios_base::sync_with_stdio(false);

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

#define sg(a, b) (a + b - 1) / b



const int MOD = 1000 * 1000 * 1000 + 7;

const int INF = 8 * 1000 * 1000 + 200;

const int MAXN =  100 * 1000 + 10;

const int MLOG = 18;

const int NMAX = 20;



struct fen{

	int fn[MAXN];

	

	void add(int idx, int val){

		for (idx++; idx < MAXN; idx += idx & -idx)

			fn[idx] += val;

	}



	void addr(int l, int r, int val = 1){

		add(l, val);

		add(r + 1, -val);

	}



	int ansq(int idx){

		int ans = 0;

		for (idx++; idx > 0; idx -= idx & -idx)

			ans += fn[idx];

		return ans;

	}

}me;



signed main(){

	IO;

	int n, m;

	cin >> n >> m;

	int seg[n][2];

	vector<pair<int, int>> vc[3 * MAXN];

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

   		cin >> seg[i][0] >> seg[i][1];

		vc[seg[i][1] - seg[i][0] + 1].pb({seg[i][0], seg[i][1]});

	}

	int x = 0;

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

		int ans = 0;

		for(int j = 0; j < sz(vc[i]); j++){

			me.addr(vc[i][j].X, vc[i][j].Y);

			x++;

		}

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

			ans += me.ansq(j);

		}

		cout << ans + n - x << endl;

	}

}

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



using namespace std;



struct Range

{

	int l,r,sz;

	Range(){}

}R[300001];



bool operator < (const Range &a, const Range &b)

{

	return a.sz < b.sz;

}



int n,m;

int ans[100011];

int Tree[100011];



void update(int x,int val)

{

	for(;x<=100010;x+=x&(-x))

		Tree[x] += val;

}



int query(int x)

{

	int ans = 0;

	for(;x>0;x-=x&(-x))

		ans += Tree[x];

	return ans;	

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);



	cin >> n >> m;

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

	{

		cin >> R[i].l >> R[i].r;

		R[i].sz = (R[i].r - R[i].l + 1);

	}	

	sort(R+1,R+1+n);

	int pos = 1;

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

	{

		while(pos <= n && R[pos].sz < i)

		{

			update(R[pos].l,1);

			update(R[pos].r+1,-1);

			pos++;

		}

		ans[i] = (n - pos + 1);

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

			ans[i] += query(j);

	}	

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

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

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

#define pb          emplace_back

#define ll          long long

#define fi          first

#define se          second

#define mp          make_pair

 

using namespace std;

 

const int N = int(3e5) + 7;

const int mod = int(1e9) + 7;

typedef pair<int, int> pii;

 

int n, m, res, l[N], r[N], t[N], remain;

vector<int> dis[N];

 

void Update(int x, int val) {for(; x < N; x += (x & -x)) t[x] += val;}

int Get(int x) {int res = 0; for(; x > 0; x -= (x & -x)) res += t[x]; return res;}

 

int32_t main() {

    ios_base::sync_with_stdio(0);

    cin.tie(0), cout.tie(0);

    #define Task        "test"

    if(fopen(Task".inp", "r")) {

        freopen(Task".inp", "r", stdin);

        freopen(Task".out", "w", stdout);

    }

    cin >> n >> m;

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

        cin >> l[i] >> r[i];

        dis[r[i] - l[i] + 1].pb(i);

    }

    remain = n;

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

       for(int j: dis[i - 1]) Update(l[j], 1), Update(r[j] + 1, -1);

       remain -= int(dis[i - 1].size()); res = remain;

       if(i != 1) for(int j = i; j <= m; j += i) res += Get(j);

       cout << res << '\n';

    }

}

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



using namespace std;



struct Range

{

	int l,r,sz;

	Range(){}

}R[300001];



bool operator < (const Range &a, const Range &b)

{

	return a.sz < b.sz;

}



int n,m;

int ans[100011];

int Tree[100011];



void update(int x,int val)

{

	for(;x<=100010;x+=x&(-x))

		Tree[x] += val;

}



int query(int x)

{

	int ans = 0;

	for(;x>0;x-=x&(-x))

		ans += Tree[x];

	return ans;	

}



int main()

{

	ios::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);



	cin >> n >> m;

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

	{

		cin >> R[i].l >> R[i].r;

		R[i].sz = (R[i].r - R[i].l + 1);

	}	

	sort(R+1,R+1+n);

	int pos = 1;

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

	{

		while(pos <= n && R[pos].sz < i)

		{

			update(R[pos].l,1);

			update(R[pos].r+1,-1);

			pos++;

		}

		ans[i] = (n - pos + 1);

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

			ans[i] += query(j);

	}	

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

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

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>

#include <vector>

#include <map>

#include <cstdlib>

#include <set>

#include <stack>

#include <queue>

using namespace std;



#define X first

#define Y second

#define N 300010

#define M 400010

typedef long long ll;

typedef pair<int,int> pii;

const int Mod=1000000007;



int n,m;

int c[N];

vector<pii> g[N];



inline int Lowbit(int x){return x&(-x);}



void Add(int x,int v)

{

	while (x<=m)

	{

		c[x]+=v;

		x+=Lowbit(x);

	}

}



int Val(int x)

{

	int res=0;

	while (x)

	{

		res+=c[x];

		x-=Lowbit(x);

	}

	return res;

}



int main()

{

	//freopen("in.in","r",stdin);

	//freopen("out.out","w",stdout);

	

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

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

	{

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

		g[r-l+1].push_back(make_pair(l,r));

	}

	int sz=0;

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

	{

		int x=i,res=0;

		do

		{

			res+=Val(x);

			x+=i;

		}while (x<=m);

		

		for (int j=0;j<g[i].size();j++)

		{

			Add(g[i][j].X,1);

			Add(g[i][j].Y+1,-1);

		}

		printf("%d\n",res+n-sz);

		sz+=g[i].size();

	}

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 9.481771533066317x):
#include <cstdio>

#include <iostream>

#include <algorithm>

 

using namespace std;

 

const int maxn = 300005;

 

int n, m;

 

#define lowbit(x) (x & (-x))

 

struct Tree

{

	int no[maxn];

	

	inline void add(int pla, int x)

	{

		for (; pla <= m; pla += lowbit(pla))

			no[pla] += x;

	}

	

	inline void add_qj(int l, int r)

	{

//		cout << "add " << l << ' ' << r << endl;

		add(l, 1);

		if (r < m)

			add(r + 1, -1);

	}

	

	inline int query(int pla)

	{

		int ans = 0;

		for (; pla; pla -= lowbit(pla))

			ans += no[pla];

		return ans;

	}

} tr;

 

struct QJ

{

	int l, r;

	inline int len() { return r - l + 1; }

	friend bool operator < (QJ a, QJ b)

	{ return a.r - a.l < b.r - b.l; }

} qj[maxn];

 

int main()

{

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

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

		scanf("%d%d", &qj[i].l, &qj[i].r);

	sort(qj + 1, qj + n + 1);

//	cout << "qj\n";

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

//		cout << qj[i].l << ' ' << qj[i].r << endl;

	int now = 1;

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

	{

		while (now <= n && qj[now].len() < i)

		{

			tr.add_qj(qj[now].l, qj[now].r);

			now++;

		}

		int ans = n - now + 1;

//		cout << "ans = " << i << ' ' << ans << ' ' << now << endl;

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

//		{

			ans += tr.query(j);

//			cout << j << ' ' << tr.query(j) << endl;

//		}

		printf("%d\n", ans);

	}

	return 0;

}
// Slower C++ solution:
#include<set>

#include<map>

#include<stack>

#include<queue>

#include<deque>

#include<cmath>

#include<cstdio>

#include<cctype>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<sstream>

#include<iostream>

#include<algorithm>

#define MAXN 300000

#define MAXM 100000

#define lowbit(x) (x&(-x))



using namespace std;



int n,m;

vector<int>gg[MAXM+80];

struct node{

	int a[MAXM+80];

	void add(int x,int A)

	{

		while(x<=m)

		{

			a[x]+=A;

			x+=lowbit(x);

		}

		return ;

	}

	int S(int x)

	{

		int sum=0;

		while(x)

		{

			sum+=a[x];

			x-=lowbit(x);

		}

		return sum;

	}

}tree;

int main()//You'll know it's a copy.

{

	int i,j,l,r,tmp=0,S;

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

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

	{

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

		gg[r-l+1].push_back(l);

	}

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

	{

		S=0;

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

			S+=tree.S(j);

		for(j=0;j<gg[i].size();j++)

			tree.add(gg[i][j],-1),tree.add(i+gg[i][j],1);

		printf("%d\n",n-tmp-S);

		tmp+=gg[i].size();

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.5568121162643025x):
#include <cstdio>

#include <iostream>

#include <algorithm>

 

using namespace std;

 

const int maxn = 300005;

 

int n, m;

 

#define lowbit(x) (x & (-x))

 

struct Tree

{

	int no[maxn];

	

	inline void add(int pla, int x)

	{

		for (; pla <= m; pla += lowbit(pla))

			no[pla] += x;

	}

	

	inline void add_qj(int l, int r)

	{

//		cout << "add " << l << ' ' << r << endl;

		add(l, 1);

		if (r < m)

			add(r + 1, -1);

	}

	

	inline int query(int pla)

	{

		int ans = 0;

		for (; pla; pla -= lowbit(pla))

			ans += no[pla];

		return ans;

	}

} tr;

 

struct QJ

{

	int l, r;

	inline int len() { return r - l + 1; }

	friend bool operator < (QJ a, QJ b)

	{ return a.r - a.l < b.r - b.l; }

} qj[maxn];

 

int main()

{

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

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

		scanf("%d%d", &qj[i].l, &qj[i].r);

	sort(qj + 1, qj + n + 1);

//	cout << "qj\n";

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

//		cout << qj[i].l << ' ' << qj[i].r << endl;

	int now = 1;

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

	{

		while (now <= n && qj[now].len() < i)

		{

			tr.add_qj(qj[now].l, qj[now].r);

			now++;

		}

		int ans = n - now + 1;

//		cout << "ans = " << i << ' ' << ans << ' ' << now << endl;

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

//		{

			ans += tr.query(j);

//			cout << j << ' ' << tr.query(j) << endl;

//		}

		printf("%d\n", ans);

	}

	return 0;

}
// Slower C++ solution:
//============================================================================

// Name        : test.cpp

// Author      : Qihan

// Version     :

// Copyright   : Your copyright notice

// Description : Hello World in C++, Ansi-style

//============================================================================



#include <bits/stdc++.h>

#define Lowbit(x) (x & (-x))

using namespace std;

typedef long long int LLI;

typedef pair<int,int> PII;

const int maxn = (300000 + 10);



struct Seg{

	int l,r,len;

}op[maxn];



bool cmp(Seg a,Seg b){

	return a.len < b.len;

}



int c[maxn];



void add(int x,int change,int n){

	while(x < n){

		c[x] += change;

		x += Lowbit(x);

	}

}



int sum(int x){

	int ans = 0;

	while(x > 0){

		ans += c[x];

		x -= Lowbit(x);

	}

	return ans;

}



int main(){

//	freopen("/home/qihan/Documents/in","r",stdin);

	int n,m;

	memset(c,0,sizeof(c));

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

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

		scanf("%d%d",&op[i].l,&op[i].r);

		op[i].len = op[i].r - op[i].l + 1;

	}

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

	int k = 1;

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

		for(;k <= n && op[k].len < i;k ++){

			add(op[k].l,1,300000);

			add(op[k].r + 1,-1,300000);

		}

		int ans = n - k + 1;

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

			ans += sum(j);

		}

		printf("%d\n",ans);

	}

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.2175606761329916x):
#include <cstdio>

#include <iostream>

#include <algorithm>

 

using namespace std;

 

const int maxn = 300005;

 

int n, m;

 

#define lowbit(x) (x & (-x))

 

struct Tree

{

	int no[maxn];

	

	inline void add(int pla, int x)

	{

		for (; pla <= m; pla += lowbit(pla))

			no[pla] += x;

	}

	

	inline void add_qj(int l, int r)

	{

//		cout << "add " << l << ' ' << r << endl;

		add(l, 1);

		if (r < m)

			add(r + 1, -1);

	}

	

	inline int query(int pla)

	{

		int ans = 0;

		for (; pla; pla -= lowbit(pla))

			ans += no[pla];

		return ans;

	}

} tr;

 

struct QJ

{

	int l, r;

	inline int len() { return r - l + 1; }

	friend bool operator < (QJ a, QJ b)

	{ return a.r - a.l < b.r - b.l; }

} qj[maxn];

 

int main()

{

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

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

		scanf("%d%d", &qj[i].l, &qj[i].r);

	sort(qj + 1, qj + n + 1);

//	cout << "qj\n";

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

//		cout << qj[i].l << ' ' << qj[i].r << endl;

	int now = 1;

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

	{

		while (now <= n && qj[now].len() < i)

		{

			tr.add_qj(qj[now].l, qj[now].r);

			now++;

		}

		int ans = n - now + 1;

//		cout << "ans = " << i << ' ' << ans << ' ' << now << endl;

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

//		{

			ans += tr.query(j);

//			cout << j << ' ' << tr.query(j) << endl;

//		}

		printf("%d\n", ans);

	}

	return 0;

}
// Slower C++ solution:
//### In The Name Of GOD ###



//%% Remember; (((He))) is The (((Accepter))) %%



// GOD IS GREATER ...



#include <bits/stdc++.h>



using namespace std;



typedef long long ll ;

typedef long double ld ;



#define int ll

#define pb push_back

#define bp pop_back

#define pf push_front

#define fp pop_front

#define X first

#define Y second

#define IO ios_base::sync_with_stdio(false);

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

#define sg(a, b) (a + b - 1) / b



const int MOD = 1000 * 1000 * 1000 + 7;

const int INF = 8 * 1000 * 1000 + 200;

const int MAXN =  100 * 1000 + 10;

const int MLOG = 18;

const int NMAX = 20;



struct fen{

	int fn[MAXN];

	

	void add(int idx, int val){

		for (idx++; idx < MAXN; idx += idx & -idx)

			fn[idx] += val;

	}



	void addr(int l, int r, int val = 1){

		add(l, val);

		add(r + 1, -val);

	}



	int ansq(int idx){

		int ans = 0;

		for (idx++; idx > 0; idx -= idx & -idx)

			ans += fn[idx];

		return ans;

	}

}me;



signed main(){

	IO;

	int n, m;

	cin >> n >> m;

	int seg[n][2];

	vector<pair<int, int>> vc[3 * MAXN];

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

   		cin >> seg[i][0] >> seg[i][1];

		vc[seg[i][1] - seg[i][0] + 1].pb({seg[i][0], seg[i][1]});

	}

	int x = 0;

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

		int ans = 0;

		for(int j = 0; j < sz(vc[i]); j++){

			me.addr(vc[i][j].X, vc[i][j].Y);

			x++;

		}

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

			ans += me.ansq(j);

		}

		cout << ans + n - x << endl;

	}

}

// Faster C++ solution for the same problem (measured speedup: 9.66025204224265x):
#include <cstdio>

#include <iostream>

#include <algorithm>

 

using namespace std;

 

const int maxn = 300005;

 

int n, m;

 

#define lowbit(x) (x & (-x))

 

struct Tree

{

	int no[maxn];

	

	inline void add(int pla, int x)

	{

		for (; pla <= m; pla += lowbit(pla))

			no[pla] += x;

	}

	

	inline void add_qj(int l, int r)

	{

//		cout << "add " << l << ' ' << r << endl;

		add(l, 1);

		if (r < m)

			add(r + 1, -1);

	}

	

	inline int query(int pla)

	{

		int ans = 0;

		for (; pla; pla -= lowbit(pla))

			ans += no[pla];

		return ans;

	}

} tr;

 

struct QJ

{

	int l, r;

	inline int len() { return r - l + 1; }

	friend bool operator < (QJ a, QJ b)

	{ return a.r - a.l < b.r - b.l; }

} qj[maxn];

 

int main()

{

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

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

		scanf("%d%d", &qj[i].l, &qj[i].r);

	sort(qj + 1, qj + n + 1);

//	cout << "qj\n";

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

//		cout << qj[i].l << ' ' << qj[i].r << endl;

	int now = 1;

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

	{

		while (now <= n && qj[now].len() < i)

		{

			tr.add_qj(qj[now].l, qj[now].r);

			now++;

		}

		int ans = n - now + 1;

//		cout << "ans = " << i << ' ' << ans << ' ' << now << endl;

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

//		{

			ans += tr.query(j);

//			cout << j << ' ' << tr.query(j) << endl;

//		}

		printf("%d\n", ans);

	}

	return 0;

}