Problem2378--Better Students Are Needed!

2378: Better Students Are Needed!

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 200200 points

Problem Statement

NN examinees took an entrance exam.
The examinee numbered ii scored A_iAi points in math and B_iBi 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.
  • 1 \le N \le 10001N1000
  • 0 \le X,Y,Z \le N0X,Y,ZN
  • 1 \le X+Y+Z \le N1X+Y+ZN
  • 0 \le A_i,B_i \le 1000Ai,Bi100

Input

Input is given from Standard Input in the following format:
NNXXYYZZA_1A1A_2A2\dotsA_NANB_1B1B_2B2\dotsB_NBN

Output

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

Sample Input Copy

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

Sample Output Copy

1
4
5

HINT

  • 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 1144, and 55. Print them in ascending order.

Source/Category