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

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

print(int(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

def solve():
    a, b = map(int, input().split())
    return  a * b // gcd(a,b)

print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
A,B=MI()
 
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:
def gcd(m,n):
    while (m % n != 0):
        temp = n
        n = m % n
        m = temp
    return(n)

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

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

Submission status: Accepted

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

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


if __name__=='__main__':
  main()

Submission status: Accepted

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

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 = [int(x) for x in input().split()]
print(A * B // fractions.gcd(A, B))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
num = 1
for i in reversed(range(1, min(a, b)+1)):
    if a % i == 0 and b % i == 0:
        a = a / i
        b = b / i
        num = i
        break

print(int(a*b*num))

Submission status: Accepted

Solution code:
import fractions
def lcm(a:int, b:int) -> int:
    return (a * b) // fractions.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())

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

Submission status: Accepted

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


def solve(A: int, B: int):
    from fractions import gcd
    return A * B // gcd(A, B)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(A, B))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
AA,BB= A,B
if A < B:
    A,B = B,A
while A%B !=0:
    t = A % B
    A = B
    B = t

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

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

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


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 as math

if __name__ == '__main__':
	A, B = map(int, input().split())
	gcd = math.gcd(A,B)
	ans = (A//gcd) * B
	print(ans)

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

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

Submission status: Accepted

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

M = max(a,b) 
m = min(a,b)
temp = M

while True:
    if temp%m == 0:
        print(temp)
        exit()
    temp += M

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

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

def prime_factorize(n):
    a = []
    while n%2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return(a)

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

A_lis = prime_factorize(A)
A_lis.append(1)
B_lis = prime_factorize(B)

ans = 1

for i in set(A_lis + B_lis):
    if A_lis.count(i) >= B_lis.count(i):
        ans = ans * (i ** A_lis.count(i))
    else:
        ans = ans * (i ** B_lis.count(i))

print(ans)

Submission status: Accepted

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

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

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

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

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 itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
A, B = map(int, input().split())
for i in range(1, B+1):
    if A*i % B == 0:
        print(A*i)
        break

Submission status: Accepted

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

s,t = map(int,input().split())
print(lcm(s,t))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a<b:
  a,b=b,a
a2=a
b2=b
while True:
  if a%b==0:
    break
  a,b=b,a%b
print(a2*b2//b)

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

A, B = rl()

from fractions import gcd
from functools import reduce

def get_gcd(A):
    return reduce(gcd, A)

def get_lcm(A):
	def lcm_base(a, b):
		return a*b//gcd(a,b)
	return reduce(lcm_base, A, 1)

print(get_lcm([A, B]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from fractions import gcd
def main():
    A, B = map(int, input().split())
    g = gcd(A, B)
    ans = A // g * B
    print(ans)
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
X, Y = map(int, input().split())

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

print(lcm(X,Y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(a,b):
  if a <= b:
    a,b = b,a
  if b == 0:
    return a
  else:
    return gcd(b,a%b)
  
A, B = (int(x) for x in input().split())
print(A*B//gcd(A,B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
x, y = (int(x) for x in input().split())

print(int((x * y) / fractions.gcd(x, y)))

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)


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

Submission status: Accepted

Solution code:
import fractions

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

res = fractions.gcd(A, B)

print(int(A*B / res))

Submission status: Accepted

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


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


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

Submission status: Accepted

Solution code:
import fractions

# 最小公倍数lcm（ least common multiple）を返す関数は用意されていない
# が、lcm(a, b) = a * b / gcd(a, b)で求められる

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

Submission status: Accepted

Solution code:
ab=list(map(int,input().split()))
i=max(ab)
while True:
  if i%ab[0]==0 and i%ab[1]==0:
    print(i)
    break
  i+=max(ab)
  #print(i)

Submission status: Accepted

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

common = 1

for i in range(2, min(A, B) + 1):
    if A % i == 0 and B % i == 0:
        common = i
result = A * B / common

print(int(result))

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:
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())
from fractions import gcd
print(int(a*b/gcd(a,b)))

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)

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

Submission status: Accepted

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


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


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from fractions import gcd
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:
# 最大公約数
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:
A,B=map(int,input().split())
def gcd(a,b):
    if a<b:
        a,b=b,a
    if b==0:
        return a
    else:
        return gcd(b,a%b)
print(int(A*B/gcd(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:
A,B = map(int,input().split())

from  fractions import gcd
C = gcd(A,B)
print(int(A*B/C))

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

Submission status: Accepted

Solution code:
import fractions
def main():
    A, B = map(int, input().split())
    gc = fractions.gcd(A, B)
    print(int(A*B/gc))
if __name__ == "__main__":
    main()

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(a, b):
    return int(a*b/gcd(a, b))

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 statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b = readInts()
    from fractions import gcd
    ans = a // gcd(a,b) * b
    print(ans)
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(lcm(a, b))

Submission status: Accepted

Solution code:
a, b = [int(_) for _ in input().split()]

def gcd(p, q):
    if q < p:
        p, q = q, p
    if q % p == 0:
        return p
    else:
        return (gcd(p, q-(q//p)*p))

print(int(a * b / gcd(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:
def gcd(p,q):
  if p%q == 0:
    return q
  return gcd(q,p%q)

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

Solution code:
num = [int(i) for i in input().split()]
A = max(num)
B = min(num)

X = A*B
num = 0
while X >= num:
  num += B
  if 0 == num % A:
    print(num)
    break
  elif X == num:
    print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from bisect import bisect_right as bsr
from collections import Counter as cnt
from collections import defaultdict as dd
from collections import deque
from fractions import gcd
from itertools import permutations as perm
from math import ceil, factorial, floor
from operator import itemgetter as ig

sys.setrecursionlimit(1000000)

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def yesno(v, yes="Yes", no="No", upper=False):
    if upper:
        print([yes.upper(), no.upper()][not v])
    else:
        print([yes, no][not v])


def lcm(v1, v2):
    """最大公約数 / 最小公倍数"""
    return (v1 // gcd(v1, v2)) * v2


def main():
    """エントリーポイント"""
    A, B = input(int, int)
    print(lcm(A, B))


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

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

import fractions

A,B=[int(x) for x in input().rstrip().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())
okashi = 1
max = 10**9
for i in range(0,max):
  if(a * okashi) % b == 0:
      break
  else:
    okashi +=1
print(a*okashi)

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:
n,m = map(int,input().split())

for a in range(1,m+1):
    if (n*a)%m==0:
        print(n*a)
        exit()

Submission status: Accepted

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

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 math import floor,ceil,sqrt,factorial,log
import fractions
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

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

a, b = MI()

print(lcm(a,b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def q3():
    def lcm(x, y):
        """ xとyの最小公倍数を求める """
        # import math
        import fractions
        return (x * y) // fractions.gcd(x, y)

    A, B = (int(i) for i in input().split())
    print(lcm(A, B))


if __name__ == '__main__':
    q3()

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
# ABC148C - Snack

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 sys

def gcd(a, b): return gcd(b, a % b) if b else abs(a)
def lcm(a, b): return abs(a // gcd(a, b) * b)

a, b = map(int, sys.stdin.readline().split())

def main():
    print(lcm(a, b))

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
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:
def yu(x, y):
    min_v = min(x, y)
    max_v = max(x, y)

    mod = max_v % min_v
    if mod != 0:
        min_v = yu(min_v, mod)
    return min_v


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

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

Submission status: Accepted

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

if a < b:
  a, b = b, a
while a % b != 0:
  a, b = b, a%b
  
print(int(c*d/b))

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

Submission status: Accepted

Solution code:
import fractions
x, y = map(int, input().split())
a = fractions.gcd(x, y)
b = int(x*y/a)
print(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 * b) // gcd(a, b)
print(lcm(a, b))

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    from fractions import gcd
    a,b =readInts()
    g = gcd(a,b)
    print(a // g * b)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
from fractions import gcd


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


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

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:
import fractions
A, B = map(int, input().split())

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

Submission status: Accepted

Solution code:
# solution
import io
import math

import fractions
nim, mike = list(map(int, input().split()))
print(nim * mike // fractions.gcd(nim, mike))

Submission status: Accepted

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

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

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

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

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

Submission status: Accepted

Solution code:
import fractions
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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

resolve()

Submission status: Accepted

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

import sys
import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
from itertools import count, cycle, repeat     # count(start[,step]), cycle(iter), repeat(elm[,n])
from itertools import groupby                  # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
from itertools import starmap                  # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    from fractions import gcd
    a, b = mi()
    # g = math.gcd(a, b)
    g = gcd(a, b)
    print(a * b // g)

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:
from fractions import gcd
l = list(map(int,input().split()))
x = l[0]
y = l[1]
print((x * y) // gcd(x, y))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
i=1
while (A*i)%B!=0:
    i += 1
print(A*i)

Submission status: Accepted

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

Submission status: Accepted

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

if B>A:
    C = A
    A = B
    B = C

while B != 0:
    a = A
    b = B
    A = B
    B = a%b
    
print(int(seki/A))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
for i in range(1,10**5):
    if a*i % b ==0:
        print(a*i)
        exit()

Submission status: Accepted

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

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