{"problem":{"name":"Snuke Line","description":{"content":"Snuke has decided to play a game, where the player runs a railway company. There are $M+1$ stations on Snuke Line, numbered $0$ through $M$. A train on Snuke Line stops at station $0$ and every $d$\\-t","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc068_c"},"statements":[{"statement_type":"Markdown","content":"Snuke has decided to play a game, where the player runs a railway company. There are $M+1$ stations on Snuke Line, numbered $0$ through $M$. A train on Snuke Line stops at station $0$ and every $d$\\-th station thereafter, where $d$ is a predetermined constant for each train. For example, if $d = 3$, the train stops at station $0$, $3$, $6$, $9$, and so forth.\nThere are $N$ kinds of souvenirs sold in areas around Snuke Line. The $i$\\-th kind of souvenirs can be purchased when the train stops at one of the following stations: stations $l_i$, $l_i+1$, $l_i+2$, $...$, $r_i$.\nThere are $M$ values of $d$, the interval between two stops, for trains on Snuke Line: $1$, $2$, $3$, $...$, $M$. For each of these $M$ values, find the number of the kinds of souvenirs that can be purchased if one takes a train with that value of $d$ at station $0$. Here, assume that it is not allowed to change trains.\n\n## Constraints\n\n*   $1 ≦ N ≦ 3 × 10^{5}$\n*   $1 ≦ M ≦ 10^{5}$\n*   $1 ≦ l_i ≦ r_i ≦ M$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n$l_1$ $r_1$\n$:$\n$l_{N}$ $r_{N}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc068_c","tags":[],"sample_group":[["3 3\n1 2\n2 3\n3 3","3\n2\n2\n\n*   If one takes a train stopping every station, three kinds of souvenirs can be purchased: kind $1$, $2$ and $3$.\n*   If one takes a train stopping every second station, two kinds of souvenirs can be purchased: kind $1$ and $2$.\n*   If one takes a train stopping every third station, two kinds of souvenirs can be purchased: kind $2$ and $3$."],["7 9\n1 7\n5 9\n5 7\n5 9\n1 1\n6 8\n3 4","7\n6\n6\n5\n4\n5\n5\n3\n2"]],"created_at":"2026-03-03 11:01:14"}}