#C6166. Relay Race Winner
Relay Race Winner
Relay Race Winner
You are given a relay race where each team is represented by a list of integers. The integer values represent the time taken by each team member to complete their part of the race. The total time for team i is computed as \(\sum_{j=1}^{n} t_{ij}\), where \(t_{ij}\) is the time taken by the j-th member of the i-th team.
Your task is to determine the winning team. The winning team is the one with the smallest total running time. If two or more teams tie, the team with the smallest index is considered the winner.
inputFormat
The input is read from standard input and is structured as follows:
- The first line contains an integer
t
representing the number of teams. - For each team, the first line contains an integer
n
representing the number of members, followed by a line containingn
space-separated integers denoting the time taken by each team member.
outputFormat
Output to standard output two integers separated by a space: the index of the winning team and the total time that team took to complete the race.
## sample3
4
10 15 20 10
4
12 14 18 10
4
11 16 17 9
2 53