#abc260b. B - Better Students Are Needed!

B - Better Students Are Needed!

Score : 200200 points

问题描述

NN 名考生参加了一场入学考试。
编号为 ii 的考生在数学考试中获得了 AiA_i 分,在英语考试中获得了 BiB_i 分。

录取规则如下:

  1. 数学成绩最高的前 XX 名考生被录取。
  2. 然后,在尚未被录取的考生中,英语成绩最高的前 YY 名考生被录取。
  3. 接着,在尚未被录取的考生中,数学和英语总分最高的前 ZZ 名考生被录取。
  4. 剩余未被录取的考生将被拒绝。

注意,在步骤 1 至 3 中,如有并列名次,则按照考生编号决定优先级:编号较小的考生优先考虑。请参阅示例输入与输出。

请按升序打印出根据上述步骤确定的被录取考生的编号,每行一个编号。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

NN examinees took an entrance exam.
The examinee numbered ii scored AiA_i points in math and BiB_i points in English.

The admissions are determined as follows.

  1. XX examinees with the highest math scores are admitted.
  2. Then, among the examinees who are not admitted yet, YY examinees with the highest English scores are admitted.
  3. Then, among the examinees who are not admitted yet, ZZ examinees with the highest total scores in math and English are admitted.
  4. Those examinees who are not admitted yet are rejected.

Here, in each of the steps 1. to 3., ties are broken by examinees' numbers: an examinee with the smaller examinee's number is prioritized. See also Sample Input and Output.

Print the examinees' numbers of the admitted examinees determined by the steps above in ascending order, separated by newlines.

Constraints

  • All values in input are integers.
  • 1N10001 \le N \le 1000
  • 0X,Y,ZN0 \le X,Y,Z \le N
  • 1X+Y+ZN1 \le X+Y+Z \le N
  • 0Ai,Bi1000 \le A_i,B_i \le 100

Input

Input is given from Standard Input in the following format:

NN XX YY ZZ

A1A_1 A2A_2 \dots ANA_N

B1B_1 B2B_2 \dots BNB_N

Output

Print the examinees' number of the admitted examinees in ascending order, separated by newlines.

Sample Input 1

6 1 0 2
80 60 80 60 70 70
40 20 50 90 90 80

Sample Output 1

1
4
5
  • First, 11 examinee with the highest math score is admitted.
    • Examinee 11 is tied with Examinee 33, scoring the highest 8080 points in math, and the tie is broken by the examinees' numbers, so Examinee 11 is admitted.
  • Then, among the examinees who are not admitted yet, 00 examinees with the highest English scores are admitted.
    • Obviously, it does not affect the admissions.
  • Then, among the examinees who are not admitted yet, 22 examinees with the highest total scores in math and English are admitted.
    • First, among the examinees who are not admitted yet, Examinee 55 is admitted, scoring the highest total score of 160160 points.
    • Next, among the examinees who are not admitted yet, Examinee 44 is tied with Examinee 66, scoring a total score of 150150 points. The tie is broken by the examinees' numbers, and Examinee 44 is admitted.

Therefore, the examinees' numbers of the admitted examinees are 11, 44, and 55. Print them in ascending order.

Sample Input 2

5 2 1 2
0 100 0 100 0
0 0 100 100 0

Sample Output 2

1
2
3
4
5

All examinees may be admitted.

Sample Input 3

15 4 3 2
30 65 20 95 100 45 70 85 20 35 95 50 40 15 85
0 25 45 35 65 70 80 90 40 55 20 20 45 75 100

Sample Output 3

2
4
5
6
7
8
11
14
15

update @ 2024/3/10 11:01:00