inlinevoidadd(int pla, int x) { for (; pla <= m; pla += lowbit(pla)) no[pla] += x; }
inlinevoidadd_qj(int l, int r) { add(l, 1); if (r < m) add(r + 1, -1); }
inlineintquery(int pla) { int ans = 0; for (; pla; pla -= lowbit(pla)) ans += no[pla]; return ans; } } tr;
structQJ { int l, r; inlineintlen(){ return r - l + 1; } friendbooloperator < (QJ a, QJ b) { return a.r - a.l < b.r - b.l; } } qj[maxn];
intmain() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; ++i) scanf("%d%d", &qj[i].l, &qj[i].r); sort(qj + 1, qj + n + 1); int now = 1; for (int i = 1; i <= m; ++i) { while (now <= n && qj[now].len() < i) { tr.add_qj(qj[now].l, qj[now].r); now++; } int ans = n - now + 1; for (int j = 0; j <= m; j += i) ans += tr.query(j); printf("%d\n", ans); } return0; }