Mock CCO '18 Contest 3 Problem 6 - Roger Asks For More Marks

View as PDF

Submit solution

Points: 30 (partial)
Time limit: 0.18s
Memory limit: 64M

Problem type

Roger has taken N tests in preparation for CCO. On each test, there were a total of bi marks available and Roger got ai marks. Roger's final score is iaiibi. Roger's test percentages are all distinct.

Roger's teacher decides that, for some value of D, Roger's D lowest percentages will be dropped in evaluating his final score. Roger discovers that it may be possible to select a different set of D tests to drop which will result in a strictly higher score. Compute all D such that this is the case.

Constraints

1N5104

0aibi<4104

bi>0

Input Specification

The first line will contain an integer N.

Each of the next N lines will contain two integers, ai and bi.

Output Specification

Output K+1 lines. On the first line, output K. On each of the next K lines, in ascending order, print the values of D for which Roger can do better than his teacher in maximizing his score. All valid values of D must be generated.

Sample Input

Copy
5
1 2
5 9
3 8
4 10
1 3

Sample Output

Copy
2
1
2

Comments

There are no comments at the moment.