#Q116. 「一本通 4.1 例 2」数星星 Stars

「一本通 4.1 例 2」数星星 Stars

Description

Original problem from: Ural 1028

There are some stars in the sky, each located at different positions with specific coordinates. A star is said to be of level kk if there are kk stars strictly to its lower left (including directly left and directly below).

stars1.png

For example, in the figure above, star 55 is level 33 (since stars 1,2,41, 2, 4 are to its lower left), and stars 2,42, 4 are level 11. The example has 11 level 00 star, 22 level 11 stars, 11 level 22 star, and 11 level 33 star.

Given the positions of the stars, output the count of stars at each level.

In one sentence  \ Given nn points, define the level of each point as the number of points strictly to its lower left (including directly left and below). Count how many points exist at each level.

Input Format

The first line contains an integer NN, the number of stars;
The next NN lines provide the coordinates of each star, given as two integers x,yx, y;
No two stars overlap. The stars are given in increasing order of yy-coordinate. If two stars share the same yy-coordinate, they are given in increasing order of xx-coordinate.

Output Format

NN lines, each containing an integer, representing the count of stars at level 00, level 11, level 22, ..., level N1N-1.

Sample 1

5
1 1
5 1
7 1
3 3
5 5

1
2
1
1
0

Data Range and Hints

For all data, 1N1.5×1041\le N\le 1.5\times 10^4, 0x,y3.2×1040\le x,y\le 3.2\times 10^4.