Programming/Python

[정올] 1658 : 최대공약수와최소공배수

pental 2020. 3. 24. 22:13
from math import gcd
def lcm(x,y):
    return x * y // gcd(x,y)

a = input()
temp = a.split(' ')
print(gcd(int(temp[0]), int(temp[1])))
print(lcm(int(temp[0]), int(temp[1])))

https://github.com/kim-do-hyeon/jungol/blob/master/1658/1658.py

 

kim-do-hyeon/jungol

Contribute to kim-do-hyeon/jungol development by creating an account on GitHub.

github.com

 

저작자표시 비영리 (새창열림)