|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|0.2 초||256 MB||7||3||3||50.000%|
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.
4 1 0 2 9000 4 1 3 10000
2 5 5