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:
import sys
stdin = sys.stdin
import numpy as np

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

a, b = na()

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

Submission status: Accepted

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

cnt = 1
while True:
    if max * cnt % min == 0:
        print(max * cnt)
        exit()
    cnt += 1

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
c = [0 for _ in range(1+max(A,B))]

ans = 1
#AとBで割り切れるような自然数を求める
# 2 <= ans <= A*B
def prime(n):
	res = [0 for _ in range(n+1)]
	for i in range(2,int(n**0.5)+1):
		while n%i == 0:
			res[i] += 1
			n = n//i
	if n != 1:
		res[n] = 1
	return res
a = prime(A)
b = prime(B)
for i in range(1+max(A,B)):
	if len(a)<=i:
		c[i] = b[i]
	elif len(b)<=i:
		c[i] = a[i]
	else:
		c[i] = max(a[i],b[i])


for i in range(1,len(c)):
	ans *= i**c[i]

print(ans)

Submission status: Accepted

Solution code:
x,y=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(x,y))

Submission status: Accepted

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

def gcd(x,y):
    x,y = sorted([x,y])
    for i in range(1,x+1):
        if x%i==0 and y%i==0:
            answer = i
    return answer

tmp_a = a//gcd(a,b)
tmp_b = b//gcd(a,b)

lcm = gcd(a,b)*tmp_a*tmp_b
print(lcm)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
x = list(map(int, input().split()))
print(x[0] * x[1] // gcd(x[0], x[1]))

Submission status: Accepted

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

def solve(A: int, B: int):
    print(A*B//fractions.gcd(A, B))
    return


# 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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = a*b

if a<b:
  s = a
  a = b
  b = s
  
r = a%b
while(r!=0):
  a = b
  b = r
  r = a%b

print(int(x/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
print(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:
# 最大公約数(Greatest Common Divisor)、最小公倍数(Least Common Multiple)
def gcd(a, b): # a >= b
  if b < a:
    a, b = b, a
  while b:
    a, b = b, a % b
  return a
def lcm(a, b): # a >= b
  return a * b // gcd(a, b)

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
N = input()
L = N.split()
a = int(L[0])
b = int(L[1])

if a < b:
    c = a
    a = b
    b = c

r = a % b
    
while r != 0:
    a = b
    b = r
    r = a % b

# この時のbが最大公約数

print(int(int(L[0])*int(L[1])/b))

Submission status: Accepted

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

Submission status: Accepted

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

from fractions import gcd
print(a*b//gcd(a, b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def g(m,n):
    if m==0:
        return n
    elif n==0:
        return m
    elif m>n:
        m=m%n
        return g(m,n)
    else:
        n=n%m
        return g(m,n)

def h(m,n):
    return m*n//g(m,n)

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

print(h(A,B))

Submission status: Accepted

Solution code:
def gcd(n,m):#n,mは正の整数、最大公約数　許容は？
    if n==0:
        return m
    elif m==0:
        return n
    elif n>m:
        n=n%m
        return gcd(n,m)
    else:
        m=m%n
        return gcd(n,m)
      
def lcm(n,m):
  return n*m//gcd(n,m)

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

Submission status: Accepted

Solution code:
def gcd(m, n):
  if n == 0:
    return m

  return gcd(n, m % n)

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
# import itertools
# import math
# import numpy as np

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


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


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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
import itertools

# import math

import numpy as np

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


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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

def gcd(m, n):
    # 入力を m, n (m ≧ n) とする。
    tmp = max(m,n)
    n = min(m,n)
    m = tmp
    # n = 0 なら、 m を出力してアルゴリズムを終了する。
    if n == 0:
        return m
    # m を n で割った余りを新たに n とし、更に 元のnを新たにm とし 2. に戻る。
    return gcd(n, m % n)

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


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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import fractions
A, B = map(int, input().split(" "))
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()) 
N=max(A,B)
M=min(A,B)
for i in range(0,M):
    if M%(M-i)==0 and N%(M-i)==0:
        Max=M-i
        break
print(A*B//Max)

Submission status: Accepted

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

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 (A*B//gcd(A,B))

Submission status: Accepted

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

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

l = gcm(a,b)
print(int(l * (a/l) * (b/l)))

Submission status: Accepted

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

Submission status: Accepted

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

print(lcm(a, b))

Submission status: Accepted

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

def gcd(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:
import fractions
a = input().split()
A, B = [int(i) for i in a]
M = fractions.gcd(A, B)
m = A * B
sol = int(m/M)
print(sol)

Submission status: Accepted

Solution code:
x,y = [ int(i) for i in input().split(" ") ]

start = 2

a, b = x, y
while a != b:
  temp = abs(a - b)
  a = min(a, b)
  b = temp


ans = x * y / a

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import *

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

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

ans = int(lcm(A, B))
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

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

n = fractions.gcd(a, b)

if n == 1:
  print(a*b)
else:
  a = a//n
  print(a*b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# 大きい値をaに
if a < b:
    a, b = b, a
A, B = a, b
while a % b != 0:
    tmp = b
    b = a % b
    a = tmp

# b is 最大公約数
ans = A * B / b
print(int(ans))

Submission status: Accepted

Solution code:
import fractions

if __name__ == '__main__':

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

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

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

print(lcm(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:
a, b = map(int, input().split())
n = 1
for i in range(1, b+1):
    if (a*i) % b == 0:
        print(a*i)
        break

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
def multiple(a, b):
    return a*b // euclid(a, b)
print(multiple(A,B))

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:
num = [int(i) for i in input().split()]
kou1 = [min(num)]
kou2 = [max(num)]
for i in range(2,min(num)):
    if min(num)%i==0:
        kou1.append(i)

for i in range(2,max(num)):
    if max(num)%i==0:
        kou2.append(i)
mav =1
for i in kou2:
    for j in kou1:
        if i ==j:
            if mav <i:
                mav = i
    
print(num[0]*num[1]//mav)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(a*b//gcd)

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の最大公約数
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)
  

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

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

Submission status: Accepted

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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
ab=input().split()
a=int(ab[0])
b=int(ab[1])
print(str(int(a*b/fractions.gcd(a,b))))

Submission status: Accepted

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

aa = list(map(int,input().split()))

lcm = 1
for a in aa:
    lcm = a*lcm//fractions.gcd(a,lcm)

print(lcm)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if a < b:
    a, b = b, a

while b*i % a != 0:
    i += 1

print(b * i)

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:
a,b = map(int,input().split())
x = a*b

if a > b:
  tmp = a
  a = b
  b = tmp
  
r = a%b
while r!=0:
  a = b
  b = r
  r = a%b
  
print(int(x/b))

Submission status: Accepted

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

a = A
b = B

while a != b:
    if a < b:
        a, b = b, a
    if a % b == 0:
        break
    a = a % b

print( A // b * B)

Submission status: Accepted

Solution code:
x = input().split()
n = int(x[0])
m = int(x[1])
N = n
M = m

r = m % n
while r != 0:
    m = n
    n = r
    r = m % n

print(int(N*M/n))

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:
A, B = map(int, input().split())
temp = A*B
r = A % B

while r != 0:
    A = B
    B = r
    r = A % B
    
LCM = temp//B
print(LCM)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def euclidean_algorithm(a, b):
    if a < b:
        tmp = b
        b = a
        a = tmp

    ｑ = a // b
    r = a % b
    while r != 0:
        a = b
        b = r
        q = a // b
        r = a % b

    return b


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

    #ユークリッド互除法(最大公約数)
    gcd = euclidean_algorithm(a, b)

    # 最小公倍数
    lcm = (a*b)//gcd
    print(lcm)

if __name__ == "__main__":
    main()

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
      
    return y
    
def lcm(m,n):
  return int((m*n) / gcd(m,n))
  

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

Submission status: Accepted

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

N = input().split()
N = [int(i) for i in N]
print(lcm(N[0],N[1]))

Submission status: Accepted

Solution code:
AB = input().split()
A = int(AB[0])
B = int(AB[1])

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
 
def lcm(m, n):
  print(int(m * n /gcd(m, n)))

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())
gcd_A, gcd_B = A, B
while gcd_B:
  gcd_A, gcd_B = gcd_B, gcd_A % gcd_B
print((A * B) // gcd_A)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache
import heapq

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

MOD = int(1e09) + 7

def main():
    A,B = cin.mapInt()
    print(Math.lcm(A,B))
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import fractions
import math

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

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

print(math.floor(lcm(A, B)))

Submission status: Accepted

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

x, y = a, b
if a > b:
    while b > 0:
        r = a % b
        a = b
        b = r
    answer = (x * y)//a
elif b > a:
    while a > 0:
        r = b % a
        b = a
        a = r
    answer = (x * y)//b
else:
    answer = (x * y)//a

print(answer)

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

Solution code:
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a


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

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

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

print(lcm(A,B))

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
import numpy as np
import collections
from collections import deque
import queue
import copy

# 最大公約数
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

# 幅優先探索(BFS)でスタート座標(x, y)からの最大距離返す
def bfs(SS, x, y, H, W):#入力(座標系(迷路), x, y, xの端, yの端)
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" #探索した場所は探索できないようにする
    for i in range(4): #このforで上下左右を調べてる
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      #print(tempx, tempy, xytuple[2])
      #print(S)
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" #探索した場所は探索できないようにする
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      #print(q)
  return mlength


#X = str(input()).split()
AB = str(input()).split()
A = int(AB[0])
B = int(AB[1])

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

print(ans)

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

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

Submission status: Accepted

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

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

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

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 sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def gcd(n, m):
  while m:
    n, m = m, n%m
  return n

def main():
    a, b = na()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
A=max(a,b)
B=min(a,b)
K=1

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

print(int((a*b)/A))

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):
    if a<b:
        t=a
        a=b
        b=t
    while b!=0:
            a,b=b,a%b
    return a

n,m=map(int,input().split())
print(int(n*m/gcd(n,m)))

Submission status: Accepted

Solution code:
import fractions
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(x, y):
    a, b = max(x, y), min(x, y)
    if b == 0:
        return a
    return gcd(a % b, b)


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


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

Submission status: Accepted

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

from fractions import gcd

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

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


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


if __name__ == '__main__':
    a, b = list(map(int, input().split(" ")))
    print(calc_lcm(a, b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = list(map(int,input().split()))
if a > b:
  a, b = b, a
c = a * b
s = b
r = a
while r != 0:
  r, s = s % r, r 
print( int(c / s) )

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
AA = A
BB = B
lcm = 1
cont = 1

while cont == 1:
  if A % B == 0 or B % A == 0:
    lcm = min(A, B)
    break
  
  if A < B:
    B = B % A
  elif A > B:
    A = A % B

ans = int(AA * BB / lcm)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
if A > B:
    a = B
    b = A
else:
    a = A
    b = B
for i in reversed(range(1,a+1)):
    if b%i == 0 and a%i == 0:  
        print(a*b//i)
        break
else:
    print(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

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

i = 1

while (A * i) % B != 0:
  i += 1

print(A * i)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect
from fractions import gcd

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import fractions

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


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


print(get_lcm(A, B))

Submission status: Accepted

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


def lcm(a, b):
    y = gcd(a,b)
    if (y == 0):
        return a*b

    else:
        return a*b/y


A, B = map(int,input().split())
if A < B:
    t = A
    A = B
    B = t

#最小公倍数
x  = int(lcm(A,B))
print(x)

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 euclid(l, r):
    ma = max(l, r)
    mi = min(l, r)
    while mi != 0:
        ma, mi = mi, ma % mi
    return ma

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