시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.2 초 256 MB244419.048%

문제

You’ve began running long distances. Simplistically, the road on which athletes race is a straight, infinite line. At some point in time all participants split into n groups of ki people each. Each group at this point in time is at coordinate xi . We know that if a group consists of D people, the group’s speed is 100/D. All groups move in the direction of coordinate’s growth. If one team catches another, they merge and their speed changes accordingly (more than two groups can merge simultaneously).

Since the road is infinite, from some point in time no more merges are possible. You, as a beginner, are interested in the number of groups remaining and the number of people in each of them.

입력

The first line contains an integer n (1 ≤ n ≤ 105 ). Each of the following n lines contains the number ki of people in the corresponding group and its coordinate xi (xi - real numbers with no more than three decimal digits and their absolute values do not exceed 104 , 1 ≤ ki ≤ 100, all the coordinates are different).

출력

The first line of output contains the number of groups m. The second line contains m integers - the number of people in each of these groups, in any order.

예제 입력 1

4
1 0
2 9000
4 1
3 10000

예제 출력 1

2
5 5