반응형
https://www.acmicpc.net/problem/1934
# @Author YoungMinKim
# baekjoon
def gcd(a,b):
if a<b:
a,b=b,a
while b!=0:
a,b= b,a%b
return a
def lcm(a,b):
return a*b // gcd(a,b)
N=int(input())
for i in range(N):
a,b = map(int,input().split())
print(lcm(a,b))
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 2163 (0) | 2020.08.24 |
---|---|
baekjoon - python - 1977 (0) | 2020.08.24 |
baekjoon - python - 1924 (0) | 2020.08.21 |
baekjoon - python - 1712 (0) | 2020.08.21 |
baekjoon - python - 1550 (0) | 2020.08.21 |
댓글