Skateboard
InterviewTime limit1sMemory limit1024 MB
Given each athlete's two run scores and five trick scores, find the highest final score, where each final score is the best run plus the top two tricks.
- Level
Easy2 of 10
- Topics
- Implementation, Sorting
- Solved
- No attempts yet
Problem
Skateboarding has been an Olympic sport since 2020, divided into street and park events. Street skating has athletes perform tricks using structures such as stairs, handrails, rails, and ramps. The street scoring works as follows.
- Each athlete makes two runs and five trick attempts, each scored from to .
- The final score is the sum of three scores: the higher of the two run scores, plus the top two of the five trick scores.
- The athlete with the highest final score wins. If several athletes share the highest score, they tie for first.
Given the score sheet of the competitors, find the final score of the winner.
Input
The first line contains the number of athletes .
From the second line, the next lines each contain seven integers separated by spaces: the scores of two runs followed by five trick scores, in that order.
Output
Print the final score of the winner on the first line.