본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 28417번 스케이트보드

by 현장 2023. 12. 30.

-Code

from sys import stdin
input = stdin.readline

n = int(input())
res = 0
for _ in range(n):
    points = list(map(int, input().split()))
    two_track = points[:2]
    five_track = sorted(points[2:])
    final_point = max(two_track) + sum(five_track[-2:])
    res = max(res, final_point)
print(res)