#K13446. Competition Analysis
Competition Analysis
Competition Analysis
You are given an integer T which denotes the number of test cases. For each test case, you are given an integer n representing the number of competitions. For each competition, three integers S, C, and R are provided, representing the time taken (in minutes) for swimming, cycling, and running respectively.
Your task is to determine, for each test case:
- The 1-indexed competition number that has the minimum total time, where the total time is given by the formula \(S + C + R\).
- The maximum single event time among all the competitions in that test case.
Note: In case of ties for the minimum total time, choose the competition that appears first.
inputFormat
The first line contains an integer \(T\) representing the number of test cases.
For each test case:
- The first line contains an integer \(n\), the number of competitions.
- The next \(n\) lines each contain three space-separated integers \(S\), \(C\), and \(R\), representing the times for the swimming, cycling, and running events respectively.
outputFormat
For each test case, output a single line containing two space-separated integers:
- The 1-indexed competition number with the minimum total time.
- The maximum time taken for any single event among all competitions in that test case.
Each test case's result should be printed on a new line.
## sample2
3
10 20 30
15 25 35
5 8 12
2
50 60 70
45 55 65
3 35
2 70
</p>