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

[백준/파이썬] 25600번 Triathlon

by 현장 2022. 10. 5.

-Code

res = 0
for _ in range(int(input())):
    a, d, g = map(int, input().split())
    total = a * (d + g)
    if a == d + g:
        total *= 2
    res = max(res, total)
print(res)