Lost Victor
Tony's standing on the greatest competitive programming stage in the world, also known as AUCPL Div B. The contest has just finished; however, it turns out the scoreboard broke at the end and is not displaying how many questions the top team solved, or how long they took to solve them.
Everyone turns to you, as you're known for being a superstar problem solver, to fix the problem. You use your top-tier skills and turn it off and on again. Shockingly, that did not work. However, you have now got a list of all the problems each team solved and the time it took to solve each one.
Can you work out what the top team's score was and their time?
Input
The first line contains an integer
— the number of teams.
The next lines contain
space-separated integers, the time to solve each question
.
Output
Output the best score and the time taken, separated by a space.
Clarifications
indicates the question was not solved.
- There were no penalties in this comp.
Example
Input 1
5
45 10 -1 -1 42 -1
-1 -1 74 -1 119 -1
41 63 53 -1 -1 52
52 5 46 90 119 8
-1 -1 3 -1 -1 -1
Output 1
6 320
Explanation
| Team | Points | Time taken |
|---|---|---|
| 1 | 3 | 97 |
| 2 | 2 | 193 |
| 3 | 4 | 209 |
| 4 | 6 | 320 |
| 5 | 1 | 3 |
Team 4 has the most points so we output their score () and their time taken (
)
Comments