[알고리즘/백준] 1934: 최소공배수(python)

유현민·2022년 4월 8일
0

알고리즘

목록 보기
109/253

두 수의 곱 / 최소공약수를 해주면 된다.

파이썬 gcd를 이용하는게 편함.

from math import gcd

for i in range(int(input())):
    a, b = map(int, input().split())
    print(int(a * b / gcd(a, b)))
profile
smilegate megaport infra

0개의 댓글