#P5759. [NOI1997] 竞赛排名
[NOI1997] 竞赛排名
Description
A city organized an all-round science and technology contest for middle school students. Each participant takes part in eight contests: Mathematics, Physics, Chemistry, Astronomy, Geography, Biology, Computer Science, and English. In the end, the overall ranking is determined based on the combined results of these eight contests.
The contestant IDs are ( is the total number of participants). Let () denote the score of contestant in contest . Other indicators are defined as follows:
- The average score of contest ():
- The total score of contestant ():
- The positional score of contestant () in contest ():
- The total positional score of contestant (): $sumy_i = \sum_{j=1}^3 y_{i, j} + 0.8 \sum_{j=4}^8 y_{i, j}$
The ranking rules are as follows:
- Contestants with higher total positional scores rank earlier.
- If two or more contestants have the same total positional score, the one with the higher total score ranks earlier.
- If two or more contestants have the same total positional score and the same total score, the one with the smaller ID ranks earlier.
Please write a program for the contest committee to compute the overall ranking for this all-round contest.
Input Format
The first line contains the total number of participants . From the second line to the -th line, the scores of contestants with IDs from to are given in order. Each line contains integers between and , representing the contestant’s scores in the 8 contests. Adjacent numbers on the same line are separated by one space.
Output Format
Output lines. From line 1 to line , output the ID of the contestant ranked 1st, the ID of the contestant ranked 2nd, , and the ID of the contestant ranked -th.
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
1
3
2
Hint
Constraints
For all testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号