P27374 [AtCoder] Exam
提高
题目描述

Problem Description

AtCoder High School has $ N $ students, numbered as Student $ 1 $, Student $ 2 $, $\ldots$, Student $ N $. One day, all students took tests in Mathematics and English. Student $ i $ $(1 \leq i \leq N)$ scored $ A_i $ points in Mathematics and $ B_i $ points in English. At AtCoder High School, the ranking of grades is determined as follows:

  • Students with higher total points in Mathematics and English are ranked higher.
  • If the total points are equal, the student with higher Mathematics points is ranked higher.
  • If both the total points and Mathematics points are equal, the student with the smaller number is ranked higher.

Output the student numbers in order from the highest to the lowest rank.

Input Format

The input is given from the standard input in the following format:

$ N $ $ A_1 $ $ A_2 $ $\ldots$ $ A_N $ $ B_1 $ $ B_2 $ $\ldots$ $ B_N $

Output Format

Output in one line in the following format:

$ X_1 $ $ X_2 $ $\ldots$ $ X_N $

where $ X_i $ is the number of the student who comes in the $ i $ -th position when the $ N $ students are ranked from the highest to the lowest based on the criteria above.

Sample Input and Output

Sample Input #1

5
5 10 10 12 5
10 10 5 0 10

Sample Output #1

2 3 1 5 4

Sample Input #2

2
0 1000000000
0 1000000000

Sample Output #2

2 1

Notes/Hints

Constraints

  • $2 \leq N \leq 2 \times 10^5$
  • $0 \leq A_i \leq 10^9$
  • $0 \leq B_i \leq 10^9$
  • All inputs are integers.

Sample Explanation 1

The ranking is determined as follows:
- The total points in Mathematics and English are $ 15 $, $ 20 $, $ 15 $, $ 12 $, $ 15 $ respectively, so Student $ 2 $ is ranked 1st, and either Student $ 1 $, $ 3 $, or $ 5 $ will be ranked 2nd, 3rd, or 4th, while Student $ 4 $ will be ranked 5th.
- Students $ 1 $, $ 3 $, and $ 5 $ have the same total points, and their Mathematics scores are $ 5 $, $ 10 $, $ 5 $ respectively, so Student $ 3 $ is ranked 2nd, and either Student $ 1 $ or $ 5 $ will be ranked 3rd or 4th.
- Students $ 1 $ and $ 5 $ have the same total points and Mathematics scores, so the smaller numbered Student $ 1 $ is ranked 3rd, and the larger numbered Student $ 5 $ is ranked 4th.
Thus, the ranking from highest to lowest is Student $ 2 $, $ 3 $, $ 1 $, $ 5 $, $ 4 $.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 5 10 10 12 5 10 10 5 0 10
样例输出
2 3 1 5 4