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 lcm(x, y):
 
   #  获取最大的数
   if x > y:
       lower = y
   else:
       lower = x
 
   while(True):
       if((x % lower == 0) and (y % lower == 0)):
           lcm = x*y//lower
           break 
       lower -= 1
 
   return lcm
print(lcm(a,b))

Submission status: Accepted

Solution code:
import fractions

def main():
  a, b = map(int, input().split())
  ans = a*b / fractions.gcd(a,b)
  print (int(ans))
  
if __name__ == "__main__":
  main()

Submission status: Accepted

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

def gcd(a,b):
    '''
    3 個以上の値の最大公約数を求めるためには、
    res = 0 と初期化
    各 i に対して res = GCD(res, x[i]) と更新する
    '''
    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:
import fractions
a,b = map(int,input().split())

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

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 math
import numpy as np
A,B = list(map(int,input().split()))
if A == 1:
  print(B)
  exit()
if B == 1:
  print(A)
  exit()
C = A*B
D = []
for i in range(int(math.sqrt(C)),1,-1):
  if A % i == 0 and B % i == 0:
    D.append(i)
    A = A // i
    B = B // i
    C = A*B
if len(D) != 0:
  p = np.prod(D)
  C = C*p
print(C)

Submission status: Accepted

Solution code:
import fractions
 
data = input().split()
val = [int(n) for n in data]
 
res = val[0] * val[1] / fractions.gcd(val[0], val[1])
 
print(int(res))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=0
if(a<b):
  c=a
  a=b
  b=c

x=a
y=b
z=x%y
while(z!=0):
    x=y
    y=z
    z=x%y
d=y
    
print(int(a*b/d))

Submission status: Accepted

Solution code:
def GCD(a,b):
    c=b//a
    d=b%a
    if d==0:
        return a
    else:
        return GCD(d,a)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = max(a,b)
d = min(a,b)
for i in range(1,a*b):
  e = c%d
  if e != 0:
    c = d
    d = e
  else:
    break
print(a*b//d)

Submission status: Accepted

Solution code:
# import math
import fractions # Python 3.4ではこちらにgcdがある

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
from fractions import gcd

def lcm(a, b):
    """ aとbの最小公倍数を返す """
    return a*b // gcd(a, b)

def solve():
    A, B = list(map(int, input().split()))

    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:
A, B = map(int, input().split())
n = 1
while True:
  if n*A % B == 0:
    print(n*A)
    break
  else:
    n += 1

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:
from fractions import gcd
#from math 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())


#最大公約数
gcd = fractions.gcd(A, B)

#最小公倍数
lcm = A*B / gcd

print(int(lcm))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
#a,bの最大公約数
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:
a,b = map(int,input().split())
x = 2
y = a
while y % b != 0:
    y = a*x
    x += 1
print(y)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
#互いに素の時は1, そうでない時は最小の公約数を出力
def coprime_checker(x,y):
    if min(x,y) == 1:
        return 1
    else:
        for i in range(2,min(x,y) + 1):
            if x % i == 0 and y % i == 0:
                return i
                break
        return 1
#
gcd = 1
x = a
y = b
while coprime_checker(int(x),int(y)) != 1:
    c = coprime_checker(int(x),int(y))
    gcd *= c
    x /= c
    y /= c
least_common_multiple  = (a*b) / gcd
print(int(least_common_multiple))

Submission status: Accepted

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

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

Submission status: Accepted

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


def solve(A: int, B: int):
    print(lcm(A, B))
    return


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


def gcd(x: int, y: int):
    """xとyの最大公約数を求める"""
    return gcd(y, x % y) if y else x


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

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(int(lcm(a,b)))

Submission status: Accepted

Solution code:
#import math
import fractions
A, B = map(int, input().split(' '))
#print(int(A * B / math.gcd(A, B)))
print(int(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:
A,B = map(int,input().split())
import fractions
L = int(A / fractions.gcd(A, B) * B)
print(L)

Submission status: Accepted

Solution code:
from fractions import gcd 

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

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

print(lcm(A, B))

Submission status: Accepted

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

flag = True
num = 1
if A>B:

    while flag:
        temp = A * num
        if temp % B == 0:
            break
        num += 1

else:
    while flag:
        temp = B * num
        if temp % A == 0:
            break
        num += 1

print(temp)

Submission status: Accepted

Solution code:
import fractions #atcorderのversionの関係で、mathmoduleでない
A,B = map(int, input().split())

def lcm(x, y):#least common multiple
    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!=0:
    x,y=y,x%y
  return x

c=a*b
d=gcd(a,b)
bai=int(c/d)

print(bai)

Submission status: Accepted

Solution code:
from fractions import gcd

a,b = [int(x) for x in input().split()]
ans = a*b/gcd(a,b)
print(int(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())


A, B = map(int, input().split())
def gcd(a,b):
    if b > a:
        return gcd(b,a)
    if b == 0:
        return a
    return gcd(a%b, b)

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = a*b
t = 0
while True:
    b %= a
    if b == 0:
        break
    else:
        t = a
        a = b
        b = t
print(c//a)

Submission status: Accepted

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

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


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

Submission status: Accepted

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

AB_max = max(A,B)
A_k = A
B_k = B
number = 2
A_soinsu = dict()
B_soinsu = dict()
soinsu = dict()
while (A_k != 1 and B_k != 1) or number <= AB_max:
    check = 0
    A_count = 0
    if A_k % number == 0:
        check = 1
        if number not in A_soinsu:
            A_soinsu[number] = 1
        else:
            A_soinsu[number] += 1
        A_count = A_soinsu[number]
        A_k = A_k / number
    
    B_count = 0
    if B_k % number == 0:
        check = 1
        if number not in B_soinsu:
            B_soinsu[number] = 1
        else:
            B_soinsu[number] += 1
        B_count = B_soinsu[number]
        B_k = B_k / number
    
    count_max = max([A_count, B_count])
    if number not in soinsu:
        soinsu[number] = count_max
    else:
        if count_max > soinsu[number]:
            soinsu[number] = count_max
    if check == 0:
        number += 1

ans = 1
for k, v in soinsu.items():
    ans = ans * (k ** v)
print(ans)

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

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

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

Submission status: Accepted

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

def LCM(a, b):
    return a // GCD(a, b) * b

def main():
    A, B = map(int, input().split())
    print(LCM(A, B))

    return 0


if __name__ == '__main__':
    main()

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 sys
input=sys.stdin.readline
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(" "))
print(int((A * B) / fractions.gcd(A, B)))

Submission status: Accepted

Solution code:
a , b = map(int, input().split())
ab = a*b
if a < b:
  a, b = b, a
while b > 0:
  a, b = b, a % b
print(ab // a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	A,B = map(int, input().split())
	A,B = max(A,B), min(A,B)
	G = gcd(A,B)
	# G:最大公約数, L:最小公倍数
	# AB=GL
	L=A*B/G
	print(int(L))

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


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:
def gcd(a, b):
    if a % b == 0:
        return b
    return gcd(b, a % b)

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9 +7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    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

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

#############
# Main Code #
#############

A,B = inputIL()

print(lcm(A,B))

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions

a, b = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Accepted

Solution code:

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

a,b=map(int,input().split())
a,b=max(a,b),min(a,b)
print(a*b//fx(a,b))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import fractions 
def solve():
  a,b = (int(i) for i in input().split())
  print(a//fractions.gcd(a,b) * b)
solve()

Submission status: Accepted

Solution code:
n = input()

a, b = n.split()

a = int(a)
b = int(b)

for i in range(10 ** 5):
    i = i + 1
    if (i * a) % b == 0:
        print(a*i)
        break

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
A,B = a,b
if A < B: A,B = B,A

while   A % B != 0:
  A,B = B,A % B

print(a * b//B)

Submission status: Accepted

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

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

abs = 1
for i in list(range(1,min(A,B)+1))[::-1]:
    if A%i==0 and B%i==0:
        abs = i
        break

print(int(A*B/abs))

Submission status: Accepted

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

if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b
gcd = b
print(int(a_input * b_input / gcd))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
X = A * B
if A < B: A, B = B, A

while B:
  A, B = B, A % B
print (X // A)

Submission status: Accepted

Solution code:
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
# mod = 10**9 + 7
from fractions import gcd
# n = int(input())

# s = deque(input())
# q = int(input())

a, b = map(int, input().split())
# a = list(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())
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)

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())
num = 0
for i in range(B + 1):
    num += A
    if  num % B == 0:
        break
print(num)

Submission status: Accepted

Solution code:
import fractions

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

for i in range(100000, 0, -1):
    if A % i == 0 and B % i == 0:
        print(A * B // i)
        exit()

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

lcm = a * b // fractions.gcd(a, b)

print(lcm)

Submission status: Accepted

Solution code:
# import bisect
# import copy
import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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


resolve()

Submission status: Accepted

Solution code:
A,B=list(map(int,input().split()))
if(A>=B):
  num=A
else:
  num=B
i=1
while True:
  ans=num*i
  if(ans%A==0 and ans%B==0):
    print(ans)
    break
  i+=1

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
big = max(a, b)
small = min(a, b)
for i in range(1, 100000):
  if big*i % small == 0:
    print(big*i)
    exit()

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
mul = A * B
while B:  
    if A < B:
        A, B = B, A
    A, B = B, A % B
print(mul // A)

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:
a,b = map(int,input().split())
ansl = []
if min(a,b) == 1:
  print(max(a,b))
else:
  for i in range(1,min(a,b)+1):
    if a%i == 0 and b%i == 0:
      ansl.append(i)
  if not ansl:
    print(a*b)
  else:
    print(int(a*b/max(ansl)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
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)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007
"""
#N,K,Mが入力
    n,k,m=LI() 
    #N
    #x1 y1
    #.  .
    #xn ynが入力
    N=I()
    p=LIR(N)
    print(n,k,m,p)
"""

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

def resolve():
    a,b=LI()
    ans=lcm(a,b)
    print(ans)

    return

import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2 3"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """123 456"""
        output = """18696"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """100000 99999"""
        output = """9999900000"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

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 sys
import math
from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))

a, b = load_list()

print(lcm(a, b))

Submission status: Accepted

Solution code:
def gcd(n,m):
    n,m=sorted([n,m])
    while(m%n!=0):
        n,m=m%n,n
    return n
def lcm(n,m):
    return n*m//gcd(n,m)
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:
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())
print(a * b // gcd(a, b))

Submission status: Accepted

Solution code:
import sys
import fractions
input = sys.stdin.readline


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

print(round(a*b/g))

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

Solution code:
import numpy as np
from collections import Counter
import fractions
import math

def hoge(p, q):
  return (p * q) // fractions.gcd(p, q)

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

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:
a,b=map(int,input().split())
import fractions
print(int(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:
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):
    if b == 0:
        return a
    return gcd(b, a % b)


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


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


if __name__ == "__main__":
    submit()

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

if __name__ == "__main__":
    solve()

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())
ans=0
mx0=max(A,B)
mn=min(A,B)
mx=mx0
while 1:
	if mx % mn == 0:
		ans=mx
		break
	else:
		mx=mx+mx0
print(ans)

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

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

def solve():
    N, M = map(int, input().split())
    return lcm(N, M)
print(solve())

Submission status: Accepted

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

def solve(a,b):
	if a < b:
		return solve(b,a)
	if b == 0:
		return a
	if b == 1:
		return b
	else:
		return solve(b,a%b)
print(a*b//solve(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 math
A, B = map(int, input().split())
gcd = 1
for i in range(2,min(A,B)+1):
  if A%i==0 and B%i==0:
    gcd = i
print(int(A*B/gcd))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

def euclid(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    A, B = MAP()
    lcm_base = lambda x, y: (x * y) // gcd(x, y)
    lcm = lambda *number: reduce(lcm_base, number, 1)
    print(lcm(A, B))


if __name__ == '__main__':
        main()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b


## 最大公約数 
def lcm(a, b):
    y = a*b / gcd(a, b)
    return int(y)
a, b = MAP()

ans = lcm(a, b)
print(ans)