#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
using namespace std;
typedef pair<int, int> P;

int n, m;
int l[300010];
int r[300010];
int sum[300010];
int ans[300010];
vector<int> dv[100010];

vector<int> divisor(int n){
	vector<int> res;
	for(int i=1;i*i<=n;i++){
		if(n%i==0){
			res.push_back(i);
			if(i!=n/i) res.push_back(n/i);
		}
	}
    sort(all(res));
    reverse(all(res));
	return res;
}

signed main(){
    cin >> n >> m;
    rep(i, 1, n + 1){
        d[i] = divisor(i);
    }
    rep(i, 0, n){
        cin >> l[i] >> r[i];
        int b = r[i] - l[i] + 1;
        if(l[i] <= b){
            sum[1]++;
            sum[r[i] + 1]--;
        }else{
            sum[l[i]]++;
            sum[r[i] + 1]--;
            sum[1]++;
            sum[b + 1]--;
            rep(j, l[i], r[i] + 1){
                rep(k, 0, dv[j].size()){
                    if(dv[j][k] <= b) break;
                    if(dv[j][k] >= l[i]) continue;
                    ans[dv[j][k]]++;
                }
                // for(int k = 2;; k++){
                //     if(j / k <= b) break;
                //     if(j % k == 0) ans[j / k]++;
                // }
            }
        }
    }
    rep(i, 1, 300010){
        sum[i] += sum[i - 1]; 
    }
    rep(i, 1, m + 1){
        cout << ans[i] + sum[i] << endl;
    }
}