#P1946. Olympic
Olympic
Description
The Olympic Games are in full swing, and many teams on the medal table need to be ranked. You need to choose three integers and , representing the score awarded for each gold, silver, and bronze medal, respectively, and they must satisfy . Teams will be sorted by their scores in descending order. Now, to make your own team rank as high as possible, you will choose .
Input Format
The first line contains an integer (), indicating that there are teams to be ranked.
Each of the following lines contains three integers (), representing the numbers of gold, silver, and bronze medals obtained by each team.
- The first team is your team.
- If the scores are equal, your team ranks first.
Output Format
Output three numbers in one line, separated by spaces.
If there are multiple solutions, output the one with the smallest . If there are still multiple solutions, output the one with the smallest . If there are still multiple solutions, output the one with the smallest .
3
1 1 1
0 1 2
2 1 0
1 1 1
Hint
Constraints
- For of the testdata, it is guaranteed that the optimal solution has .
- For of the testdata, it is guaranteed that the optimal solution has .
Translated by ChatGPT 5
京公网安备 11011102002149号