#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint operator^(const ll& t)const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

///////////////////////////

template <typename T, typename E>

struct lst {
	using F = function<T(T, T)>;//ノードのもつ値同士の演算
	using G = function<T(T, E, ll)>;//ノードへの更新作用(llは区間の長さ)
	using H = function<E(E, E)>;//更新のmerge

	ll n;
	F f;
	G g;
	H h;
	T ti;
	E ei;

	ll size;
	vector<ll> node, lazy;

	lst(ll n0, F f0, G g0, H h0, T ti0, E ei0) {
		n = n0;
		f = f0; g = g0; h = h0; ti = ti0; ei = ei0;

		size = 1;
		while (size < n) {
			size *= 2;
		}

		node.assign(2 * size, ti);
		lazy.assign(2 * size, ei);
	}

	void eval(ll k, ll l, ll r) {//k=[l,r)の評価
		if (lazy[k] != 0) {
			node[k] = g(node[k], lazy[k], (r - l));
		}

		if (k < size) {
			lazy[2 * k] = h(lazy[2 * k], lazy[k]);
			lazy[2 * k + 1] = h(lazy[2 * k + 1], lazy[k]);
		}

		lazy[k] = 0;
	}

	void update_prep(ll a, ll b, E x, ll k, ll l, ll r) {
		eval(k, l, r);

		if (b <= l || r <= a) { return; }

		if (a <= l && r <= b) {
			lazy[k] = h(lazy[k], x);
			eval(k, l, r);
			return;
		}

		update_prep(a, b, x, 2 * k, l, (l + r) / 2);
		update_prep(a, b, x, 2 * k + 1, (l + r) / 2, r);
		node[k] = f(node[2 * k], node[2 * k + 1]);
	}

	void update(ll a, ll b, E x) {//[a,b)の更新
		return update_prep(a, b, x, 1, 1, size + 1);
	}

	T query_prep(ll a, ll b, ll k, ll l, ll r) {

		eval(k, l, r);

		if (b <= l || r <= a) { return ti; }
		if (a <= l && r <= b) { return node[k]; }

		T v1 = query_prep(a, b, 2 * k, l, (l + r) / 2);
		T v2 = query_prep(a, b, 2 * k + 1, (l + r) / 2, r);
		return f(v1, v2);

	}

	T query(ll a, ll b) {
		return query_prep(a, b, 1, 1, size + 1);
	}

};

int main() {
	ll N, M;
	cin >> N >> M;

	vector<vector<ll>> div(2*M + 1);
	repn(i, M) {
		for (ll j = i; j <= 2*M; j += i) {
			div[j].push_back(i);
		}
	}

	function<ll(ll, ll)> f = [](ll a, ll b) {return a + b; };
	function<ll(ll, ll, ll)> g = [](ll a, ll b, ll c) {return a + b * c; };
	function<ll(ll, ll)> h = [](ll a, ll b) {return a + b; };
	
	lst<ll, ll> lst(2*M, f, g, h, 0, 0);

	vector<pair<ll, ll>> sv(N + 1);
	repn(i, N)cin >> sv[i].second >> sv[i].first;
	sort(++sv.begin(), sv.end());
	
	vector<ll> ans(M + 1, N);
	ll k = 1;

	repn(r, 2*M) {
		
		while(k<=N&&sv[k].first<=r-1){
			lst.update(1,sv[k].second+1,1);
			k++;
		}


		for (ll j : div[r]) {
			ll l = r - j + 1;
			ll x = lst.query(l, l + 1);
			//cout << r<<" "<<j << endl << flush;
			ans[j] -= x;
		}
	}

	repn(i, M) {
		cout << ans[i] << endl;
	}

	

	
}


Measured memory_bytes: 49024