Go Back
Declaring Winners (100)

ByteCamp2019 judges have allotted scores to every team based on their performance in working prototype(X1), abstract level(X2), abstract scalability(X3) and Question-answer round(X4). They have decided to declare 3 winning teams (First, Second and Third).
Now to declare winners, the judges have to go through scores of all the rounds of each team and declare the top 3 winners (from total of score). Help them to go through the scores of each team and declare winner for the ByteCamp2019.


The first line of input contains an integer T denoting the number of test cases.
First line of each test case contains N denoting number of teams.
Next 4 lines contains the scores of the teams of each round (X1,X2,X3,X4) in the increasing order of team number.


For each test case output a single line containing 3 space separated Team numbers (first, second and then third).
If total score of team matches with other team declare winner according to their score given in prototype round(X1).
Note : No line should end with an extra space


T <= 100
N <= 50
0 <= X1,X2,X3,X4 <= 100
X1[i] != X1[j]

Copy Input

7 4 8 3 4
5 2 3 4 5
5 3 4 5 6
8 6 4 2 1
1 3 5


Team 1 is first. (7+5+5+8=25)
Team 3 is second. (8+3+4+4=19)
Team 5 is third. (4+5+6+1=16)

Single Round Match #07
3 hour contest

Register for Bytecamp 2019 here: https://bytecamp19.hackerearth.com/

Problem Tags
math, sorting

Supported by our Coding Partner