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:
from fractions import gcd

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

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

if __name__ == '__main__':
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    print(lcm(A, B))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def gcd(x,y):
    if x<y:
        x,y=y,x
    if y==0:
        return x
    else:
        return gcd(y,x%y)
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())
f=fractions.gcd(a,b)
f2=a*b//f

print(f2)

Submission status: Accepted

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

def lcm(x, y):
    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())

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

Submission status: Accepted

Solution code:
a, b=(int(i) for i in 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 sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    a = I()
    b = I()
    print(6 - a - b)
    return


# B
def B():
    n = I()
    s, t = input().split(' ')
    ans = []
    for i in range(n):
        ans.append(s[i])
        ans.append(t[i])
    print(''.join(ans))
    return


# C
def C():
    def GCD(a, b):
        if (b == 0):
            return a
        else:
            return GCD(b, a % b)

    a, b = LI()
    print(a * b // GCD(a, b))
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    C()
    return


# Solve
if __name__ == "__main__":
    C()

Submission status: Accepted

Solution code:
from sys import stdin
import platform
ver = platform.python_version_tuple()
if int(ver[1]) < 5:
    from fractions import gcd
else:
    from math import gcd


def main():
    input = lambda: stdin.readline()[:-1]
    A, B = map(int, input().split())

    lcm = lambda x, y: x * y // gcd(x, y)
    print(lcm(A, B))


main()

Submission status: Accepted

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

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:
a,b=map(int,input().split())
def gcd(x,y):
  if x < y:
    x, y = y, x
  while x % y != 0:
    x, y = y, x % y
  return y
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:
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


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

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

Submission status: Accepted

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

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

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

print(lcm(a, b))

Submission status: Accepted

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

# from math import gcd
def gcd(a, b):
	if a < b:
	    a, b = b, a
	while a % b != 0:
	    a, b = b, a % b
	return(b)

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

Submission status: Accepted

Solution code:
def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

Submission status: Accepted

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

inp = input().split()
A = int(inp[0])
B = int(inp[1])

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

Submission status: Accepted

Solution code:
def gcd(m, n):
  x=max(m, n)
  y=min(m, n)
  while x%y!=0:
    z=x%y
    x=y
    y=z
  else:
    return(y)

A,B=map(int, input().split())
print(int(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 a*b//gcd(a,b)
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( int(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:
from fractions import gcd
a,b=map(int,input().split())
ans=a*b/gcd(a,b)
print(int(ans))

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True
#for i in range(n):

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

a,b=LI()

ans=[]


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import collections
#sys.setrecursionlimit(100000)

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

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

print(lcm(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 a*b//gcd(a,b)

a,b=map(int, input().split())  
print(lcm(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:
import fractions

str_list = input().split(' ')
int_list = [int(x) for x in str_list]
A, B = int_list[0], int_list[1]

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

Submission status: Accepted

Solution code:
def main():
	# n = int(input())
	# b = int(input())
	a,b = list(map(int,input().split()))
	# A = [list(map(int, input().split())) for _ in range(H)]
	
	import fractions
	# import math
	def lcm(x, y):
		return (x * y) // fractions.gcd(x, y)
	# print(fractions.gcd(a,b))
	
	print(lcm(a,b))

	




if __name__ == '__main__':
	main()

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 * b // gcd (a, b)
print(lcm(a,b))

Submission status: Accepted

Solution code:
import fractions

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

R = A * B // fractions.gcd(A, B)

print(R)

Submission status: Accepted

Solution code:
def gcd(x, y):
    while y > 0:
        x, y = y, x % y
    return x


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)
print((a*b)//g)

Submission status: Accepted

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

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 sys import stdout
import fractions
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b = inm()
m = fractions.gcd(a,b)
print((a*b)//m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
input_l = list(map(int,input().split()))
a = input_l[0]
b = input_l[1]
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())
print(lcm(a,b))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# lcm & gcd not math
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

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

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())
answer = a*b//fractions.gcd(a, b)
print(answer)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        else:
            return z

lcm = a * b / gcd(a, b)
print(int(lcm))

Submission status: Accepted

Solution code:
import sys
import fractions
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
A=a[0]
B=a[1]

import fractions

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions

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

A, B = [int(_) for _ in input().split()]

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions
a,b=list(map(int,input().strip().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


def main():
    a, b = list(map(int, input().split()))
    N = a * b // gcd(a, b)
    print(N)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import fractions

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

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

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:
from fractions import gcd
 
a,b = map(int, input().split())

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

ans = lcm(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:
import sys
sys.setrecursionlimit(1000000)
A,B=map(int,input().split())
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

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

Submission status: Accepted

Solution code:
def gcd(m, n):
    if m < n:
        return gcd(n, m)
    if n == 0:
        return m
    return gcd(n, m % n)
A, B = map(int, input().split())
print(A * B // gcd(A, B))

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
print(int((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())
def gcd(a,b):
    while b!=0:
      a,b=b,a%b
    return a
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())
ans = a * b // fractions.gcd(a, b)
print(ans)

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:
import fractions

A, B = [int(x) for x in input().split()]
C = fractions.gcd(A, B)
print(A * B // C)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
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)
print(lcm(a,b))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import fractions

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

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

Submission status: Accepted

Solution code:
import math
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())

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	A,B = inputMap()

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



def gcd(a, b):
	if a > b:
		a, b = b, a

	while a > 0:
		a, b = b % a, a
	return b

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

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import fractions as f
a,b =[int(x) for x in input().split()]
def lcm(x, y):
    return (x * y) // f.gcd(x, y)

print(lcm(a, b))

Submission status: Accepted

Solution code:
# import math

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

# print(a * b // math.gcd(a, b))

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

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
def gcd(a, b):
    x = min(a, b)
    y = max(a, b)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        else:
            return z


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


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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
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)

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

Submission status: Accepted

Solution code:
# coding:utf-8
import fractions


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

Submission status: Accepted

Solution code:
import fractions as f

A, B = map(int, input().split())
print(A * B // f.gcd(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:
a, b = map(int, input().split())

# 最大公倍数、最小公倍数
from functools import reduce


def gcd(x, y):
    while y != 0:
        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:
from fractions import gcd

A, B = [int(i) for i in input().split()]

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

print(lcm)

Submission status: Accepted

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

Submission status: Accepted

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

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

def run():
  A, B = map(int, input().split())
  ans = lcm(A, B)
  print(ans)
  
if __name__ == '__main__':
  run()

Submission status: Accepted

Solution code:
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)

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

print(lcm(a,b))

Submission status: Accepted

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

min = (a * b) // gcd(a,b)

print(min)

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())
f = fractions.gcd(A, B)
f2 = A * B // f
print(f2)

Submission status: Accepted

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

Submission status: Accepted

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


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


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

Submission status: Accepted

Solution code:
import math
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:
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:
import sys
import math
input = sys.stdin.readline


def main():
    sc = Scan()
    a, b = sc.intarr()
    print(lcm(a, b))


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def intarr_ver(self, n):
        return [int(input()) for _ in range(n)]

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


def display(array):
    for a in range(len(array)):
        if len(array) - a != 1:
            print(array[a], end=' ')
        else:
            print(array[a])


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


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


def natural_num(n):
    for j in range(2, int(math.sqrt(n))+1):
        if n % j == 0:
            return 0
    return 1


main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	a,b = map(int,input().split())
	print(a*b//gcd([a,b]))

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

	if temp!=1:
		arr.append([temp, 1])

	if arr==[]:
		arr.append([n, 1])

	return arr

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(numbers):
	return reduce(fractions.gcd, numbers)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

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

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

class PriorityQueue():
	def __init__(self):
		self.queue = []
	def push(self,i):
		heapq.heappush(self.queue,-i)
	def pop(self):
		return -1 * heapq.heappop(self.queue)
	def sum(self):
		return -sum(self.queue)

main()

Submission status: Accepted

Solution code:
import math

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

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

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

print(lcm(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())
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
print(a*b//(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())
print(lcm(a, b))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
INF = float("inf") #const
MOD = 10**9+7 #const
MAX = 510000 #const

import fractions as frt

def main():
    a,b = map(int,input().split())
    print(a*b//frt.gcd(a,b))


if __name__ == "__main__":
    main()

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())

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


print(lcm(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 a * b // gcd(a, b)

if __name__ == "__main__":
	A, B = map(int, input().split())
	if A < B:
		A, B = B, A
	print(lcm(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:
import fractions
def main():
    A, B = [int(a) for a in input().split()]
    gcd = fractions.gcd(A, B)
    print(A * B // gcd)
main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
import fractions
 
gcd=fractions.gcd(a,b)#最大公約数
lcm=a*b//gcd#最小公倍数least common multiple
print(lcm)

Submission status: Accepted

Solution code:
import fractions
def lcm(a, b):
    return (a*b) // fractions.gcd(a, b)
x = [int(i) for i in input().split()]
print(lcm(x[0], x[1]))

Submission status: Accepted

Solution code:
s,t=map(int,input().split())

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

def lcm(a, b):
    return a * b // gcd (a, b)
  
print(lcm(s,t))

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline())
def LI(): return [int(x) for x in sys.stdin.readline().split()]

def solv(a,b):
    a_ = a
    b_ = b
    while(a_%b_ != 0):
        a_,b_ = b_,a_%b_
    return a*b//b_
    
def main():
    A,B = LI()
    print(solv(A,B))

if __name__ == "__main__":
    main()

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

aa = A
bb = B
while aa != bb:
    if aa < bb:
        aa += A
    else:
        bb += B

print(aa)

Submission status: Accepted

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys

sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline-------------------------------------------- 
    a,b = map(int,input().split())
    print(a*b//gcd(a,b))



if __name__ == "__main__":
    main() #endline===============================================

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import math
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:
def gcm(a,b):
    if a < b:
        a,b = b,a
    while True:
        if a % b == 0:
            return b
        else:
            a,b = b,a % b

def lcm(a,b):
    g = gcm(a,b)
    return a*b//g;

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

Submission status: Accepted

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

def read():
    A, B = list(map(int, input().strip().split()))
    return A, B


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


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))