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

[백준/파이썬] 23276번 Locust Locus

by 현장 2024. 8. 10.

-Code

from math import lcm
res = 1e9

for _ in range(int(input())):
    y, c1, c2 = map(int, input().split())
    res = min(y + lcm(c1, c2), res)

print(res)