#arc068c. [arc068_c]Snuke Line

[arc068_c]Snuke Line

Problem Statement

Snuke has decided to play a game, where the player runs a railway company. There are M+1M+1 stations on Snuke Line, numbered 00 through MM. A train on Snuke Line stops at station 00 and every dd-th station thereafter, where dd is a predetermined constant for each train. For example, if d=3d = 3, the train stops at station 00, 33, 66, 99, and so forth.

There are NN kinds of souvenirs sold in areas around Snuke Line. The ii-th kind of souvenirs can be purchased when the train stops at one of the following stations: stations lil_i, li+1l_i+1, li+2l_i+2, ......, rir_i.

There are MM values of dd, the interval between two stops, for trains on Snuke Line: 11, 22, 33, ......, MM. For each of these MM values, find the number of the kinds of souvenirs that can be purchased if one takes a train with that value of dd at station 00. Here, assume that it is not allowed to change trains.

Constraints

  • 1N3×1051 ≦ N ≦ 3 × 10^{5}
  • 1M1051 ≦ M ≦ 10^{5}
  • 1liriM1 ≦ l_i ≦ r_i ≦ M

Input

The input is given from Standard Input in the following format:

NN MM l1l_1 r1r_1 :: lNl_{N} rNr_{N}

Output

Print the answer in MM lines. The ii-th line should contain the maximum number of the kinds of souvenirs that can be purchased if one takes a train stopping every ii-th station.


Sample Input 1

3 3
1 2
2 3
3 3

Sample Output 1

3
2
2
  • If one takes a train stopping every station, three kinds of souvenirs can be purchased: kind 11, 22 and 33.
  • If one takes a train stopping every second station, two kinds of souvenirs can be purchased: kind 11 and 22.
  • If one takes a train stopping every third station, two kinds of souvenirs can be purchased: kind 22 and 33.

Sample Input 2

7 9
1 7
5 9
5 7
5 9
1 1
6 8
3 4

Sample Output 2

7
6
6
5
4
5
5
3
2