Given up to three contestants' scores, submission counts, and last scoring upload times, output the number of the top-ranked contestant by the tie-break rules.
Easy2SortingImplementationInterviewNo attempts yetTime limit1sMemory limit512 MBThe Ajou Programming Contest (APC) ran for Ajou University students from its first edition in 2009 through its sixth edition in 2014. In 2017, Hyeonjeong watched the campus contests other schools were running and decided to bring APC back after three years.
The 2017 APC works like this.
The standings follow from that format.
Hyeonjeong has not slept properly for days and is short-tempered. Write a program that computes the standings so she can rest for a while.
The first line contains a natural number N (1≤N≤3), the number of contestants.
Each of the next N lines contains three integers Si, Ci, Li (0≤Si≤620, 0≤Ci≤50, 0≤Li≤179). Line 1+i gives, in order, the score of contestant i, that contestant's submission count, and the upload time of the last problem on which that contestant earned points. No two contestants have all three values equal.
Print the number of the contestant who finishes first, on one line.