20250902 baekjoon
This commit is contained in:
parent
234b3de4a9
commit
dc7c1fb0b3
5
code_study/Baekjoon/python/13241.py
Normal file
5
code_study/Baekjoon/python/13241.py
Normal file
@ -0,0 +1,5 @@
|
||||
A, B = map(int, input().split())
|
||||
temp = A*B
|
||||
while B != 0 :
|
||||
A, B = B, A%B
|
||||
print(temp//A)
|
||||
18
code_study/Baekjoon/python/1735.py
Normal file
18
code_study/Baekjoon/python/1735.py
Normal file
@ -0,0 +1,18 @@
|
||||
def gcd(n,m) :
|
||||
temp = [n,m]
|
||||
n = max(temp)
|
||||
m = min(temp)
|
||||
if m==0 :
|
||||
return n
|
||||
return gcd(m,n%m)
|
||||
|
||||
def lcm(n,m) :
|
||||
return n*m//gcd(n,m)
|
||||
|
||||
a,b = map(int,input().split())
|
||||
c,d = map(int,input().split())
|
||||
denom = lcm(b,d)
|
||||
num = a*(denom//b) + c*(denom//d)
|
||||
|
||||
factor = gcd(num, denom)
|
||||
print(num//factor, denom//factor)
|
||||
6
code_study/Baekjoon/python/1934.py
Normal file
6
code_study/Baekjoon/python/1934.py
Normal file
@ -0,0 +1,6 @@
|
||||
for _ in range(int(input())) :
|
||||
A, B = map(int, input().split())
|
||||
temp = A*B
|
||||
while B != 0 :
|
||||
A, B = B, A%B
|
||||
print(temp//A)
|
||||
Loading…
x
Reference in New Issue
Block a user