Dream, Passion, Sharing
InterviewTime limit2sMemory limit1024 MB
Pick Jaewon plus up to M-1 students whose stat totals do not exceed his own, so the team's combined total is maximized.
Problem
Jaewon is a Dimigo student who is choosing teammates for the Dimigo startup idea contest.
A team can enter the contest with at most members.
Under the school motto of dream, passion, and sharing, each of the Dimigo students, including Jaewon, has dream, passion, and sharing stats. Jaewon's number is , and his stats are , , and . The other students are numbered from to , and student has stats , , and .
Jaewon wants to choose teammates so that the team, including himself, has at least 1 and at most members, and the total of all members' dream, passion, and sharing stats is as large as possible.
Jaewon wants to keep his team easy to manage, so he will not pick any student whose stat total is greater than his own stat total .
Input
The first line contains the number of students and the maximum team size , separated by a space.
The second line contains Jaewon's stats , , and , separated by spaces.
From the third line onward, the lines give student 's stats , , and , separated by spaces.
All input numbers are integers.
Output
Print the numbers of the students on the team, including Jaewon's number, separated by spaces, for a team that satisfies the conditions.
If several teams maximize the total stats, print any one of them.
The members may be printed in any order.