102601: [AtCoder]ABC260 B - Better Students Are Needed!

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

Problem Statement

$N$ examinees took an entrance exam.
The examinee numbered $i$ scored $A_i$ points in math and $B_i$ points in English.

The admissions are determined as follows.

  1. $X$ examinees with the highest math scores are admitted.
  2. Then, among the examinees who are not admitted yet, $Y$ examinees with the highest English scores are admitted.
  3. Then, among the examinees who are not admitted yet, $Z$ 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.
  • $1 \le N \le 1000$
  • $0 \le X,Y,Z \le N$
  • $1 \le X+Y+Z \le N$
  • $0 \le A_i,B_i \le 100$

Input

Input is given from Standard Input in the following format:

$N$ $X$ $Y$ $Z$
$A_1$ $A_2$ $\dots$ $A_N$
$B_1$ $B_2$ $\dots$ $B_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, $1$ examinee with the highest math score is admitted.
    • Examinee $1$ is tied with Examinee $3$, scoring the highest $80$ points in math, and the tie is broken by the examinees' numbers, so Examinee $1$ is admitted.
  • Then, among the examinees who are not admitted yet, $0$ examinees with the highest English scores are admitted.
    • Obviously, it does not affect the admissions.
  • Then, among the examinees who are not admitted yet, $2$ examinees with the highest total scores in math and English are admitted.
    • First, among the examinees who are not admitted yet, Examinee $5$ is admitted, scoring the highest total score of $160$ points.
    • Next, among the examinees who are not admitted yet, Examinee $4$ is tied with Examinee $6$, scoring a total score of $150$ points. The tie is broken by the examinees' numbers, and Examinee $4$ is admitted.

Therefore, the examinees' numbers of the admitted examinees are $1$, $4$, and $5$. 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

Input

题意翻译

一次入学考试后,第 $i$ 个学生的数学成绩是 $A_i$,英语成绩是 $B_i$,考试合格者的决定如下: 1. 以数学分数高的前 $X$ 人为合格。 2. 接着,在还没有合格的应试者中,以英语分数高的前 $Y$ 者为合格。 3. 接着,在此时还未合格的应试者中,以数学和英语合计分数高的前 $Z$ 人为合格。 4. 到此为止还未合格的考生,视为不合格。 如果分数一样,则编号小的学生优先。 从小到大输出及格的学生编号。

Output

得分:$200$分 部分 ## 问题描述 $N$ 名考生参加了入学考试。 编号为 $i$ 的考生在数学中得了 $A_i$ 分,在英语中得了 $B_i$ 分。 录取方式如下。 1. $X$ 名数学分数最高的考生被录取。 2. 然后,在尚未被录取的考生中,$Y$ 名英语分数最高的考生被录取。 3. 然后,在尚未被录取的考生中,$Z$ 名数学和英语总分最高的考生被录取。 4. 尚未被录取的考生被拒绝。 在步骤 1. 至 3. 中,如果出现平局,则按考生的编号决定:编号较小的考生优先。参见示例输入和输出。 以升序按行分隔的方式打印按照上述步骤确定的被录取考生的编号。 部分 ## 约束 * 输入中的所有值均为整数。 * $1 \le N \le 1000$ * $0 \le X,Y,Z \le N$ * $1 \le X+Y+Z \le N$ * $0 \le A_i,B_i \le 100$ 部分 --- ## 输入 标准输入提供以下格式的输入: ``` $N$ $X$ $Y$ $Z$ $A_1$ $A_2$ $\dots$ $A_N$ $B_1$ $B_2$ $\dots$ $B_N$ ``` 部分 --- ## 输出 以升序按行分隔的方式打印被录取考生的编号。 部分 --- ## 示例输入 1 ``` 6 1 0 2 80 60 80 60 70 70 40 20 50 90 90 80 ``` 部分 --- ## 示例输出 1 ``` 1 4 5 ``` * 首先,$1$ 名数学分数最高的考生被录取。 * 考生 $1$ 与考生 $3$ 并列最高,数学分数均为 $80$,并根据考生编号打破平局,因此考生 $1$ 被录取。 * 然后,在尚未被录取的考生中,$0$ 名英语分数最高的考生被录取。 * 显然,这对录取没有影响。 * 然后,在尚未被录取的考生中,$2$ 名数学和英语总分最高的考生被录取。 * 首先,在尚未被录取的考生中,考生 $5$ 以最高的总分 $160$ 被录取。 * 接下来,在尚未被录取的考生中,考生 $4$ 与考生 $6$ 并列,总分为 $150$。根据考生编号打破平局,并录取考生 $4$。 * 因此,被录取考生的编号为 $1$、$4$ 和 $5$。按升序打印它们。 部分 --- ## 示例输入 2 ``` 5 2 1 2 0 100 0 100 0 0 0 100 100 0 ``` 部分 --- ## 示例输出 2 ``` 1 2 3 4 5 ``` * 可以录取所有考生。 部分 --- ## 示例输入 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 ```

加入题单

上一题 下一题 算法标签: