#include<cstdio>
#include<algorithm>
using namespace std;
inline int read()
{
	int x;char c;
	while((c=getchar())<'0'||c>'9');
	for(x=c-'0';(c=getchar())>='0'&&c<='9';)x=x*10+c-'0';
	return x;
}
#define MM 100000
#define MX 1600000
#define N 131072
struct work{int t,l,r;}w[MX+5];
bool cmp(const work&a,const work&b){return a.r!=b.r?a.r<b.r:a.t>b.t;}
int ans[MM+5],wn,t[N*2+5];
void inc(int k){for(k+=N;k;k>>=1)++t[k];}
int query(int l,int r)
{
	int res=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1)res+=t[l+1];
		if( r&1)res+=t[r-1];
	}
	return res;
}
int main()
{
	int n,m,i,j;
	n=read();m=read();
	for(i=1;i<=n;++i)w[++wn].l=read(),w[wn].r=read();
	for(i=1;i<=m;++i)for(j=0;j<m;j+=i)w[++wn]=(work){1,i,j+i};
	sort(w+1,w+wn+1,cmp);
	for(i=1;i<=wn;++i)
		if(w[i].t)ans[w[i].l]+=query(w[i].r-w[i].l+1,MM);
		else inc(w[i].l);
	for(i=1;i<=m;++i)printf("%d\n",n-ans[i]);
}