// 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.19410512228549x):
#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

}