National Olympiad in Informatics, China, 1997
A city organized an all-around high school science Olympiad where
Let
- The average score of the
-th competition is , . - The overall score of competitor
is , . - The rank of competitor
in the -th competition is: - The overall position score for competitor
is , .
The rules for ranking are as follows:
- Competitors with higher overall position scores are ranked higher.
- If two or more competitors have the same overall position score, then the competitor(s) with a higher overall score is ranked higher.
- If two or more competitors have the same overall position score and the overall score, then the competitor(s) with the smaller ID is ranked higher.
Please write a program for the organizers to compute the rankings of competitors.
Input Specification
The first line of input contains the integer
Output Specification
The output should contain
Sample Input
3
72 82 73 68 95 86 82 90
72 90 50 60 80 70 65 80
72 82 73 68 95 86 82 90
Sample Output
1
3
2
Problem translated to English by .
Comments