Problem:


Score : 300 points

Problem Statement

Takahashi is organizing a party.

At the party, each guest will receive one or more snack pieces.

Takahashi predicts that the number of guests at this party will be A or B.

Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.

We assume that a piece cannot be divided and distributed to multiple guests.

Constraints

1 \leq A, B \leq 10^5

A \neq B

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.

Sample Input 1

2 3

Sample Output 1

6

When we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.

Sample Input 2

123 456

Sample Output 2

18696

Sample Input 3

100000 99999

Sample Output 3

9999900000



Sample input:
2 3


Sample output:
6

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

def factorization(n):
    arr = []
    tmp = n

    for i in range(2, int(n**0.5//1)+1):
        if tmp%i==0:
            cnt = 0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if tmp!=1:
        arr.append([tmp,1])
    if arr==[]:
        arr.append([n,1])
    return arr

a_arr = factorization(a)
b_arr = factorization(b)
a_map = {str(arr[0]):arr[1] for arr in a_arr}
b_map = {str(arr[0]):arr[1] for arr in b_arr}

factor = set(list(a_map.keys())+list(b_map.keys()))
ans = 1
for i in factor:
  if str(i) in a_map.keys():
    a_num = a_map[str(i)]
  else:
    a_num = 0
    
  if str(i) in b_map.keys():
    b_num = b_map[str(i)]
  else:
    b_num = 0
  
  ans *= int(i)**(max(a_num,b_num))
print(ans)

Submission status: Accepted

Solution code:
import math
def lcm(x, y):
  return (x * y) // math.gcd(x, y)
a,b=map(int,input().split())
print(lcm(a,b))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

from math import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(A, B))

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline

A, B = list(map(int, readline().split()))

def gcd(a,b):
    while b > 0:
        a, b = b, a % b

    return a

ans = A * B // gcd(A, B)
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

import math

ans = a*b/math.gcd(a,b)
print(int(ans))

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))

Submission status: Accepted

Solution code:
import math

m,n = map(int,input().split())

print(m*n//(math.gcd(m, n)))

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
ans = A * B / math.gcd(A, B)
print(int(ans))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
L = max(A, B)
S = min(A, B)
ans = L
while True:
    if ans%S==0:
        print(ans)
        break
    ans+=L

Submission status: Accepted

Solution code:
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A, B = map(int, input().split(' '))
print(lcm(A, B))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

import math
G = math.gcd(A,B)

print(A*B//G)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
for i in range(1,B+1):
    if((A*i)%B==0):
        print(A*i)
        exit()

Submission status: Accepted

Solution code:
import math
[a,b] = [int(i) for i in input().split()]
print(a * b // math.gcd(a,b))

Submission status: Accepted

Solution code:
import math

A, B = map(int,input().split())

result = (A * B) // math.gcd(A, B)

print(result)

Submission status: Accepted

Solution code:
# 最大公約数を求める
def gcm(m, n):
    # mを小さくする
    if m > n:
        _temp = n
        n = m
        m = _temp

    while m != 0:
        #print("{}, {}".format(m, n))
        m, n = n % m, m

    return n

a, b, = map(int, input().split())
g = gcm(a, b)

print("{}".format((int)(a * b / g)))

Submission status: Accepted

Solution code:
import math

A, B = (int(x) for x in input().split())

def lcm(x, y):
  return (x*y) // math.gcd(x, y)

print(lcm(A, B))

Submission status: Accepted

Solution code:
import numpy as np
a, b = map(int, input().split())
print(np.lcm(a, b))

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())

ans=int((A*B)/math.gcd(A,B))

print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
def gcd(x,y):
  while y!=0:
    x,y = y,x%y
  return x
m = gcd(max(a,b),min(a,b))
print(a*b//m)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(1, 100001):
    if (A * i) % B == 0:
        print(A * i)
        break

Submission status: Accepted

Solution code:
import math
A,B = input().split()
A = int(A)
B = int(B)
x = int(math.gcd(A,B))
print((A*B)//x)

Submission status: Accepted

Solution code:
import math


def main():
    A, B = map(int,input().split())
    print(int(A*B/math.gcd(A,B)))


if __name__ =="__main__":
    main()

Submission status: Accepted

Solution code:
def gcd(a,b):
    while True:
#         print(a,b)
        if a >= b:
            x = a
            y = b
        else:
            x = b
            y = a

        mod = x%y

        if mod == 0:
            return y
        
        else:
            a = y
            b = mod

A,B = list(map(int,input().split()))
ans = int(A*B / gcd(A,B))
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
def g(x,y):
  while y: x,y=y,x%y
  return x
print(a*b//g(a,b))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
from math import *
print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
import math

A, B = map(int, input().split())
print(A * B // math.gcd(A,B))

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())

print(int((A*B)/math.gcd(A, B)))

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
print(int(a*b/math.gcd(a,b)))

Submission status: Accepted

Solution code:
import math
A,B = (int(x) for x in input().split())
print(A*B//math.gcd(A,B))

Submission status: Accepted

Solution code:
import math
a, b = list(map(int, input().split()))
c = math.gcd(a, b)
d = a * b / c
d = math.floor(d)
print(d)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
import math

print(int(A*B/math.gcd(A,B)))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
def lcm(a, b):
    return a // gcd(a, b) * b

ans = lcm(A, B)
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=0
d=0
if a<b:
    c=a
else:
    c=b
for i in range(1,c+1):
    if a%i==0 and b%i==0:
        d=i
    
print(a*b//d)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
g = math.gcd(a, b)
print(a * b // g)

Submission status: Accepted

Solution code:
from fractions import gcd 
a, b = map(int,input().split())
print((a*b)//gcd(a,b))

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
ans = lcm(a, b)
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
INF = 200005

big = max(a,b)
small = min(a,b)

for x in range(big,big*small+1,big):
    if x % small == 0:
        print(x)
        break

Submission status: Accepted

Solution code:
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
def main():
    a,b = map(int,input().split())
    print(lcm(a, b))
main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate
from fractions import gcd
# from math import gcd
def lcm(x, y):
  return x // gcd(x, y) * y

def solve():
    a, b = MI()
    print(lcm(a, b))

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int, input().split())
print((A * B) // gcd(A, B))

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect


def gcd(a, b):
    """最大公約数"""
    a, b = (a, b) if a >= b else (b, a)
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    """最小公倍数"""
    # from math import gcd
    return (a * b) // gcd(a, b)


# from decorator import stop_watch
#
#
# @stop_watch
def solve(A, B):
    print(lcm(A, B))


if __name__ == '__main__':
    A, B = map(int, input().split())
    solve(A, B)

Submission status: Accepted

Solution code:
# 148c

from sys import stdin
import fractions

a, b=map(int, stdin.readline().strip().split())
f=fractions.gcd(a,b)
f2=a*b//f

print(f2)

Submission status: Accepted

Solution code:
import fractions
A,B=map(int,input().split())
print(A*B//fractions.gcd(A,B))

Submission status: Accepted

Solution code:
#C
A,B=map(int,input().split())
GCD=1
for i in range(2,10**5+1):
    if A%i==0 and B%i==0:
        GCD=i

LCM=A*B/GCD
print(int(LCM))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
C - Snack
https://atcoder.jp/contests/abc148/tasks/abc148_c

"""
import sys


from fractions import gcd

def solve(A, B):
    return A * B // gcd(A, B)


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import fractions

def lcm(x,y):
  return (x*y)//fractions.gcd(x,y)

A,B=map(int,input().split())
print(lcm(A,B))

Submission status: Accepted

Solution code:
A,B = input().split()

max_num = max(int(A),int(B))
min_num = min(int(A),int(B))
i = 0
flag = False

while flag == False:
    i += 1
    if (max_num*i)% min_num == 0:
        print(max_num*i)
        flag = True

Submission status: Accepted

Solution code:
from fractions import gcd
a,b = map(int, input().split())
c = gcd(a, b)
print(a*b//c)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())

import fractions
print(A*B//fractions.gcd(A,B))

Submission status: Accepted

Solution code:
import fractions

A,B = (int(a) for a in input().split())
print(A * B // fractions.gcd(A,B))

Submission status: Accepted

Solution code:
import fractions 
a,b=map(int,input().split())
c = fractions.gcd(a,b)
print(int((a*b)/c))

Submission status: Accepted

Solution code:
from fractions import gcd
a,b = map(int, input().split())

print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:

def lcm(x, y):
    from fractions import gcd
    return (x * y) // gcd(x, y) 

a,b = map(int,input().split())

print(lcm(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd
a, b = map(int, input().split())

ans = (a * b) // gcd(a, b)
print(ans)

Submission status: Accepted

Solution code:
def q_c():
    a, b = map(int, input().split())

    if a > b:
        tmp = a
        a = b
        b = tmp

    b0 = b
    a0 = a
    while b % a != 0:
        c = b % a
        b = a
        a = c

    print(int(b0 * a0 / a))


if __name__ == '__main__':
    q_c()

Submission status: Accepted

Solution code:
import fractions as math
input_line = list(map(int,input().split(' ')))

ans = input_line[0] * input_line[1] // math.gcd(input_line[0], input_line[1])
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
m=min(a,b)
kouyakusuu=1
for i in range(1,m+1):
    if a%i==0 and b%i==0:
        kouyakusuu=i
print(a*b//kouyakusuu)

Submission status: Accepted

Solution code:
import fractions


a, b = map(int, input().split())
ans = int(a * b / fractions.gcd(a, b))
print(ans)

Submission status: Accepted

Solution code:
import math
import numpy as np
A,B = np.array(input().split(),dtype = int)

def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)

print(int(A*B/(gcd(A,B))))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

import fractions
g = fractions.gcd(a, b)
print(a * b // g)

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
import fractions
gcd = fractions.gcd
a,b = ma()
print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd

a, b = map(int, input().split())

print(a * b // gcd(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int,input().split())
print(A*B//gcd(A,B))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9
import fractions

def main():
    a,b = map(int, input().split())

    print(a*b//fractions.gcd(a, b))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
import fractions
def lem(x,y):
	return (x * y) // fractions.gcd(x,y)

A,B = map(int, input().split())
print(lem(A,B))

Submission status: Accepted

Solution code:
def gcd2(x,y):
    if y == 0: return x
    return gcd2(y,x % y)

def lcm2(x,y):
    return x // gcd2(x,y) * y

a,b = map(int,input().split())
print(lcm2(a,b))

Submission status: Accepted

Solution code:
import fractions
A,B=map(int,input().split())
C=fractions.gcd(A,B)
print(int(A*B/C))

Submission status: Accepted

Solution code:
import fractions
a,b = map(int, input().split())
k = fractions.gcd(a,b)
print(a * b // k)

Submission status: Accepted

Solution code:
import fractions
a, b = map(int, input().split())

def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)

print(lcm(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd
a, b = map(int, input().split())
print(a*b//gcd(a, b))

Submission status: Accepted

Solution code:
import sys
import fractions
input = lambda: sys.stdin.readline().rstrip()

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def main():
    a, b = map(int, input().split())
    print(lcm(a, b))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ma,mi=0,0
ma=max(A,B)
mi=min(A,B)

if A%B==0 or B%A==0:
    print(ma)

else :
    for i in range(2,ma+1):
        if (ma*i)%mi==0:
            print(ma*i)
            break
        i+=(mi-1)

Submission status: Accepted

Solution code:
from fractions import gcd
A, B = map(int, input().split())

print(A*B//gcd(A, B))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=0
for i in range(1,10000000000):
    if b*i%a==0:
        x=i
        break
    elif b*i==b*a:
        x=a
        break
print(b*x)

Submission status: Accepted

Solution code:
import fractions
A,B = map(int,input().split())
print(A*B//fractions.gcd(A,B))

Submission status: Accepted

Solution code:
import fractions

A, B = map(int, input().split())

print(int(A * B / fractions.gcd(A, B)))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
if a > b:
  for i in range(1, a + 1):
    if b * i % a == 0:
      ans = b * i
      break
else:
  for i in range(1, b + 1):
    if a * i % b == 0:
      ans = a * i
      break
print(ans)

Submission status: Accepted

Solution code:
import fractions
a, b = map(int, input().split())

print(int(a*b / fractions.gcd(a,b)))

Submission status: Accepted

Solution code:
import fractions
x,y=map(int,input().split())
print((x * y) // fractions.gcd(x, y))

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = a[0]
while b % a[1] != 0:
  b += a[0]
print(b)

Submission status: Accepted

Solution code:
def resolve():
    A, B = map(int, input().split())
    ans = []
    for i in range(1, min(A, B)+1):
        if A%i == 0 and B%i == 0:
            ans.append(i)
    print(A*B//ans[-1])
resolve()

Submission status: Accepted

Solution code:
from sys import stdin

input=stdin.readline

#ユークリッド互除法
def gcd(a, b):
  dekai = max(a, b)
  tiisai = min(a, b)
  
  div = dekai % tiisai
  next_dived=tiisai
  #次割られるのは，さっき割り込んできたやつ
  #次割るのは，さっきの計算で出た余り
  while (div != 0):
    tmp=div
    div = next_dived % div
    next_dived=tmp

  return next_dived

A,B=map(int,input().split())

#print(gcd(A,B))

print (A*B//gcd(A,B))

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools
import queue
from collections import deque
from fractions import Fraction

# 最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

def main():
    a, b = map(int, input().split())
    print(lcm(a, b))



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from fractions import gcd

a,b = map(int,input().split())
print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
import fractions
a,b=map(int,input().split())
print(int(a*b/fractions.gcd(a,b)))

Submission status: Accepted

Solution code:
import sys
A, B = map(int, input().split())
A_, B_ = A, B
counta, countb = 1, 1
while True:
    if A == B:
        print(A)
        sys.exit()
    elif A > B:
        countb += 1
        B = B_ * countb
    elif B > A:
        counta += 1
        A = A_ * counta

Submission status: Accepted

Solution code:
from fractions import gcd
a, b = map(int, input().split())
lcm = a * b // gcd(a, b)
print(lcm)

Submission status: Accepted

Solution code:
import fractions
a,b = map(int,input().split())

print(int(a * b / fractions.gcd(a, b)))

Submission status: Accepted

Solution code:
from fractions import gcd
a,b=map(int,input().split())
def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(a, b))

Submission status: Accepted

Solution code:
import fractions

a, b = map(int, input().split())

print((a * b) // fractions.gcd(a, b))

Submission status: Accepted

Solution code:
import fractions
A,B = map(int,input().split())
print((A*B)//fractions.gcd(A,B))

Submission status: Accepted

Solution code:
import fractions

A, B = map(int, input().split())

print(A*B//fractions.gcd(A, B))

Submission status: Accepted

Solution code:
import fractions

def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)

a,b=map(int,input().split())
ans=lcm(a,b)
print(ans)

Submission status: Accepted

Solution code:
from fractions import gcd

a, b = map(int, input().split())
print(a * b // gcd(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int, input().split())

ans = (A * B) // gcd(A, B)

print(ans)

Submission status: Accepted

Solution code:
from fractions import gcd 
a,b=map(int,input().split())
print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int, input().split())
# 最大公約数で割ったら最小公倍数
print(A * B // gcd(A, B))

Submission status: Accepted

Solution code:
import fractions
A,B=map(int,input().split())
print(A*B//fractions.gcd(A,B))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

a,b=list(map(int,input().split()))

print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
def gcd(a,b):
    while b!=0:
        a,b = b,a%b
    return a

def lcm(a,b):
    return int(a*b/gcd(a,b))

A,B=list(map(int,input().split()))
print(lcm(A,B))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
l=gcd(a,b)
print(int(a*b/l))

Submission status: Accepted

Solution code:
A, B = list(map(int,input().split()))

def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def lcm_(x,y):
    return (x * y) // gcd_(x, y)

print(lcm_(A, B))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

ans=0
for i in range(1,a+1):
  if b%i==0:
    if a%i==0:
      ans=max(ans,i)
      
print((a*b)//ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

for i in range(1,B+1):
  ans = A * i
  if ans % B == 0:
    break

print(ans)

Submission status: Accepted

Solution code:
import fractions

a,b = list(map(int, input().split()))

print(int(a * b / fractions.gcd(a,b)))

Submission status: Accepted

Solution code:
import fractions

def is_lcm(X, Y):
    return X*Y // fractions.gcd(X, Y)

N, M = map(int, input().split())

print(is_lcm(N, M))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from fractions import gcd

def main():
    A, B = map(int, input().split())
    print(A * B // gcd(A, B))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B = map(int, input().split())

tmp_A, tmp_B = max(A,B), min(A,B)

while 1:
  if tmp_A % tmp_B != 0:
    tmp = tmp_B
    tmp_B = tmp_A%tmp_B
    tmp_A = tmp
  else:
    if tmp_B == 1:
      result = A*B
      break
    else:
      result = int(A*B/tmp_B)
      break
print(result)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

print((a*b)//gcd(a,b))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n


def lcm(m, n):
    return m // gcd(m, n) * n


a, b = map(int, readline().split())
print(lcm(a,b))

Submission status: Accepted

Solution code:
a,b=map(int, input().split())

def gcd(l,s):
    r = l%s
    if r == 0:
        return s
    else:
        return gcd(s,r)

def lcm(x,y):
    return (x * y) // gcd(x, y)

print(lcm(a,b))

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))

large = A if A > B else B
small = A if A < B else B

def gcd(large, small):
    r = large % small
    while r != 0:
        large = small
        small = r
        r = large % small
    return small

print(large*small//gcd(large, small))

Submission status: Accepted

Solution code:
def gcd(a,b):
    r = a%b
    if r==0:
        return b
    else:
        return gcd(b,r)

def lcm(x,y):
    return (x * y) // gcd(x, y)
n,m=map(int, input().split())
print(lcm(n,m))

Submission status: Accepted

Solution code:
import fractions
a,b = map(int,input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(a, b))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

#最大公約数
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

#最小公倍数
def lcm(x, y):
    return x * y // gcd(x, y)

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions

a, b = map(int, input().split())

print(a * b // fractions.gcd(a, b))

Submission status: Accepted

Solution code:
A,B = map(int,(input().split()))

l = 0
if A > B: 
    l = A
    s = B
else:
    l = B
    s = A

for i in range(1,10**10):
    if (l*i)%s == 0:
        print(l*i)
        exit()
    else:
        continue

Submission status: Accepted

Solution code:
from fractions import gcd
A, B = map(int, input().split())


def BIG_SMALL(A, B):
    if A % B == 0:
        print(A)
    else:
        print(A*B//gcd(A,B))


if A > B:
    BIG_SMALL(A, B)
elif A < B:
    BIG_SMALL(B, A)
else:
    print(A)

Submission status: Accepted

Solution code:
from fractions import gcd


def func(A, B):
    ans = (A * B) // gcd(A, B)
    return ans


if __name__ == "__main__":
    A, B = map(int, input().split())
    print(func(A, B))

Submission status: Accepted

Solution code:
import fractions
a,b = map(int,input().split())
ans = a * b // fractions.gcd(a, b)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import fractions
a, b = map(int, input().split())
print(a*b//fractions.gcd(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd
A,B=map(int,input().split())
print(A*B//gcd(A,B))

Submission status: Accepted

Solution code:
from fractions import gcd
a, b = map(int, input().split())
print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd

a, b = map(int, input().split())

print(a*b//gcd(a, b))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
import fractions
ans = a*b // fractions.gcd(a,b)
print(ans)

Submission status: Accepted

Solution code:
import fractions

A, B = map(int, input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(A,B))

Submission status: Accepted

Solution code:
from fractions import gcd
A, B = map(int, input().split())
print(A*B//gcd(A, B))

Submission status: Accepted

Solution code:
from fractions import gcd

a, b = map(int,input().split())

def lcm(x, y):
    return (x*y)//gcd(x,y)
    
tmp = lcm(a, b)
print(tmp)

Submission status: Accepted

Solution code:
from fractions import gcd

a,b = map(int,input().split())

def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd
a, b = map(int, input().split())

def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

a , b = map(int,input().split())

print(a * b // gcd(a, b))

Submission status: Accepted

Solution code:
def find_lcm(a, b):
    """lcm = least common multiple
    """
    large_num = max(a, b)
    small_num = min(a, b)

    count = 1
    while True:
        
        if large_num * count % small_num == 0:
            break
        count += 1
    
    return large_num * count

if __name__ == "__main__":
    A, B = map(int, input().split())
    print(find_lcm(A, B))

Submission status: Accepted

Solution code:
def gcd(a, b):
    if a<b:
        a,b = b,a
    r = a%b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b
a,b = map(int,input().split())
print(a * b // gcd(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int, input().split())

print(str((A * B) // gcd(A, B)))

Submission status: Accepted

Solution code:
import fractions

A, B = map(int, input().split())

print(str(A * B // fractions.gcd(A, B)))

Submission status: Accepted

Solution code:
import fractions
a,b=map(int,input().split())
print((a * b) // fractions.gcd(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd
import sys
sys.setrecursionlimit(10**7)
a,b = map(int,input().split())
def lcm(x, y):
    return (x * y) // gcd(x, y)
if b != 0:
    print(lcm(a, b))
else:
    print(a)

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int, input().split())

print(A * B // gcd(A, B))

Submission status: Accepted

Solution code:
import fractions

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

A,B=map(int,input().split())    
print(lcm_base(A,B))

Submission status: Accepted

Solution code:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a, b = map(int, input().split())
print(lcm(a, b))

Submission status: Accepted

Solution code:
A,B = list(map(int, input().split()))

def gcd(a, b):
    if (b == 0):
        return a
    else:
        return gcd(b, a%b)

print(A*B // gcd(A, B))

Submission status: Accepted

Solution code:
def gcd(a, b):
    for i in range(min(a, b), 0, -1):
        if a%i == 0 and b%i == 0:
            return i


A, B = map(int, input().split())
print((A*B) // gcd(A, B))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())

import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(A,B))

Submission status: Accepted

Solution code:
import fractions
a,b = map(int,input().split())
lcm = fractions.gcd(a,b)
print(a*b // lcm)

Submission status: Accepted

Solution code:
import fractions
A,B=map(int,input().split())
c=A*B/fractions.gcd(A,B)
print(int(c))

Submission status: Accepted

Solution code:
import fractions

a , b = (int(x) for x in input().split())

result = fractions.gcd(a, b)

print((a * b) // result)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import fractions

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    A, B = map(int, readline().split())
    print(A * B // fractions.gcd(A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/python3

import sys
#import math
import fractions as math

def input():
    return sys.stdin.readline().rstrip('\n')

#N = int(input())
A,B = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A,B))

Submission status: Accepted

Solution code:
import fractions
A, B = map(int, input().split())
print(A * B // fractions.gcd(A,B))

Submission status: Accepted

Solution code:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
ans=a*b/c
print(int(ans))

Submission status: Accepted

Solution code:
import fractions as math

def main():
    x, y = map(int, input().split())
    print(x*y // math.gcd(x,y))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import fractions
A, B = map(int, input().split())
print(int(A * B / fractions.gcd(A, B)))

Submission status: Accepted

Solution code:
from fractions import gcd
def lcm(a,b): return a*b//gcd(a,b)
a,b=map(int,input().split())
print(lcm(a,b))

Submission status: Accepted

Solution code:
def gcd(a,b):
	return gcd(b, a% b) if b else a
a,b = map(int,raw_input().split(' '))
print a * b / gcd(a,b)

Submission status: Accepted

Solution code:
from fractions import gcd

A, B = map(int, input().split())
print(A*B//gcd(A, B))

Submission status: Accepted

Solution code:
import fractions
a,b=map(int,input().split())
g=fractions.gcd(a, b)
l=int(a*b/g)
print(l)

Submission status: Accepted

Solution code:
import fractions
A,B = map(int, input().split())
print(int(A*B//fractions.gcd(A,B)))

Submission status: Accepted

Solution code:
A=list(map(int,input().split()))
x=max(A)
n=min(A)
while(n!=0):
    x,n=n,x%n
print(int(max(A)*min(A)/x))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
import fractions
print(a*b//fractions.gcd(a,b))

Submission status: Accepted

Solution code:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

import math
A,B=map(int,input().split())

print(A*B//gcd(A,B))