반응형
https://www.acmicpc.net/problem/2609
# @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)
a,b=map(int,input().split())
print(gcd(a,b))
print(lcm(a,b))
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 2739 (0) | 2020.08.25 |
---|---|
baekjoon - python - 2675 (0) | 2020.08.25 |
baekjoon - python - 2588 (0) | 2020.08.25 |
baekjoon - python - 2577 (0) | 2020.08.25 |
baekjoon - python - 2562 (0) | 2020.08.25 |
댓글