#Lutece1584. Washi与Sonochi的约定

Washi与Sonochi的约定

Migrated from Lutece 1584 Washi与Sonochi的约定

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

SonochiSonochi,明年再一起看烟花。——WashioSumiWashio\,Sumi

为了实现和SonochiSonochi的约定,WashiWashi必须要打败眼前强大的怪物。
怪物分布在二维平面上,
某个怪物的rankrank被定义为xx坐标不大于其xx坐标,且yy坐标不大于其yy坐标的怪物的数量。(不含其自身)
WashiWashi要你输出nn行,每行一个整数,分别代表rankrank0n10\sim n-1的怪物数量。

Input

输入第一行为一个正整数nn
接下来nn行,第ii行两个整数xix_iyiy_i,表示一个怪物的坐标。
保证输入的坐标两两不同。

Output

包含nn行,每行一个整数,第ii行的数代表rankranki1i-1的怪物数量。

Samples

5
1 1
5 1
7 1
3 3
5 5
1
2
1
1
0

Note

1n1000001{\leq}n{\leq}100000
1xi1000001{\leq}x_i{\leq}100000
1yi1000001{\leq}y_i{\leq}100000

Resources

17暑假前集训-数据结构专题 By AutSky_JadeK,思路非原创 - poj 2352