반응형
# @Author YoungMinKim
# baekjoon
import sys
from math import gcd
A1,A2 = map(int,sys.stdin.readline().split())
B1,B2 = map(int,sys.stdin.readline().split())
mom = A2*B2
child = B2*A1 + A2*B1
if gcd(mom,child) != 1:
mom2 = mom // gcd(mom,child)
child2 = child//gcd(mom,child)
print(child2,mom2)
else:print(child,mom)
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 2566 (0) | 2020.12.06 |
---|---|
baekjoon - python - 5597 (0) | 2020.12.06 |
baekjoon - python - 9093 (0) | 2020.11.22 |
baekjoon - python - 6603 (0) | 2020.11.02 |
baekjoon - python - 10101 (0) | 2020.10.28 |
댓글