// 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.1374915412860287x):
#include <bits/stdc++.h>



using namespace std;



#define endl "\n"

#define fi first

#define se second

#define pb push_back

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

#define rall(x) (x).rbegin(), (x).rend()

#define fastio { ios_base::sync_with_stdio(false), cin.tie(NULL); }

#define forn(i, n) for(int i = 0; i < (int)(n); i++)

#define for1(i, n) for(int i = 1; i <= (int)(n); i++)

#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)



#ifdef RICARDO

//Header here

	#include "E:\\Code\\dbg.h"

#else

	#define bug(...) "RICARDO MILOS"

#endif





template<class T> bool mini(T &a, T b) { return a > b ? (a = b, true) : false; }

template<class T> bool maxi(T &a, T b) { return a < b ? (a = b, true) : false; }



typedef pair<int, int> pii;

typedef vector<int> vi;

typedef vector<pii> vpi;

typedef vector<vi> vvi;

typedef long long i64;

typedef vector<i64> vi64;

typedef vector<vi64> vvi64;

typedef pair<i64, i64> pi64;

typedef double ld;



//=================================================CODE=================================================//



signed main()

{	

	fastio;

	cout.precision(10);

	cout << fixed;

#ifdef RICARDO		

	freopen("i", "r", stdin);

#endif

	int n, m; cin >> m >> n;

	vpi prs(m);

	for(auto &e : prs) cin >> e.fi >> e.se;

	sort(rall(prs));



	//siege

	vvi D(n + 1);

	for1(i, n) {

		D[0].pb(i);

		for(int j = i; j <= n; j += i) D[j].pb(i);

	}

	//



	vi bit(n + 1, 0);

	auto up = [&](int i) {

		for(; i <= n; i += i & -i) bit[i]++;

	};

	auto get = [&](int i) {

		int RES = 0;

		for(; i; i -= i & -i) RES += bit[i];

		return RES;

	};



	vi ANS(n + 1, m);

	int cur = 0;

	ford(i, n) {

		while(cur < m && prs[cur].fi > i) {

			up(prs[cur].se);			

			cur++;			

		}



		for(int v : D[i]) {

			int j = i + v;

			ANS[v] -= get(min(j - 1, n));						

		}	

	}



	for1(i, n) cout << ANS[i] << endl;

#ifdef RICARDO

	cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";

#endif

}