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:
number_of_guests = input().split()

A = int(number_of_guests[0])
B = int(number_of_guests[1])


A_divisors = []
x = 2
while True:
    if (A % x == 0):
        A /= x
        A_divisors.append(x)
    else:
        x += 1

    if (A <= 1):
        break

y = 2
B_divisors = []
while True:
    if (B % y == 0):
        B /= y
        B_divisors.append(y)
    else:
        y += 1

    if (B <= 1):
        break

A_only = [x for x in A_divisors if (x not in B_divisors)]
B_only = [y for y in B_divisors if (y not in A_divisors)]

common_divisors = []
for z in (A_divisors + B_divisors):
    if z in A_divisors and z in B_divisors:
        if (A_divisors.count(z) >= B_divisors.count(z)):
            common_divisors.append(z**A_divisors.count(z))
        else:
            common_divisors.append(z**B_divisors.count(z))

        A_divisors = list(filter(lambda x: x != z, A_divisors))
        B_divisors = list(filter(lambda x: x != z, B_divisors))


result = 1
for x in A_only + B_only + common_divisors:
    result *= x

print(result)

Submission status: Accepted

Solution code:
a, b = input().split()
product = int(a) * int(b);
complete = product
tmp = product
for i in range(2, min(int(a), int(b)) + 1):
    tmp = product / i
    if tmp % int(b) == 0 and tmp % int(a) == 0:
        complete = tmp
print(int(complete))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

m = A
n = B

while (m % n != 0):
    tmp = n
    n = m % n
    m = tmp
    
ans = A * B / n

print(int(ans))

Submission status: Accepted

Solution code:

import fractions

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

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

"""
/を使うと結果が小数floatになるため、
小数点以下を切り捨て整数の除算結果を
返す//（整数除算）を使っている。
"""

Submission status: Accepted

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

Submission status: Accepted

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

a=max(A,B)
b=min(A,B)
while True:
  if a%b==0:
    break
  else:
    a,b=b,a%b
  
o=int(A*B/b)
print(o)

Submission status: Accepted

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

large_num = 0
small_num = 0
if a > b:
  large_num = a
  small_num = b
else:
  large_num = b
  small_num = a

div_result = 0

for n in range(large_num):
  result1 = large_num%(n+1)
  result2 = small_num%(n+1)
  if result1==0 and result2 ==0:
    div_result = n+1

result = int(large_num/div_result*small_num)
print(result)

Submission status: Accepted

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


def gcd(a, b):
    """Compute the greatest common divisor of a and b"""
    while b > 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    """Compute the lowest common multiple of a and b"""
    return a * b / gcd(a, b)

print(int(lcm(a,b)))

Submission status: Accepted

Solution code:
import fractions

x,y=map(int, input().split()) 

ans=(x * y) // fractions.gcd(x, y)

print(ans)

Submission status: Accepted

Solution code:
A, B=[int(i) for i in 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())
x=a*b
if(a<b):
    temp=a
    a=b
    b=temp

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

print(x//b)

Submission status: Accepted

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

a_bun = []
b_bun = []

i = 2
a_target = a
while i <= a_target: # 3 < 41
  if a_target % i == 0:
    a_bun.append(i)
    a_target = int(a_target /i)
  else:
    i= i + 1

i = 2
b_target = b
while i <= b_target: # 2 < 228
  if b_target % i == 0:
    b_bun.append(i)
    b_target = int(b_target /i)
  else:
    i= i + 1
#  print("{}\t{}".format(i,b_target))

result = 1
for i in a_bun:
  result = result * i
  if i in b_bun:
    b_bun.remove(i)

for j in b_bun:
  result = result * j

print(result)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
import fractions
def lcm(A,B):
    return (A * B) // fractions.gcd(A, B)
print(lcm(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 read():
    A,B =map(int,input().split())

    return A,B


def solve(A,B):
    ans=lcm(A,B)
    return ans


if __name__ == '__main__':
    A,B = read()
    print("%d" % solve(A,B))

Submission status: Accepted

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

def gcd(A,B):
    while B:
        A, B = B, A % B

    return A

def solve(A: int, B: int):
    print( (A*B) // 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:
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:
# -*- coding: utf-8 -*-
import numpy as np
A, B = map(int, input().split())

L = max(A, B)
S = min(A, B)
flag = 1
while(flag == 1):
  #print(L, S)
  if(L % S == 0):
    flag = 0
    lval = S
  else:
    tmp = L % S
    L = S
    S = tmp

Ar = A // lval
Br = B // lval

print(int(lval*Ar*Br))

Submission status: Accepted

Solution code:
import math

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

S = b

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

aa = (prime_factorize(a))
bb = (prime_factorize(b))

def f(a1, b1):
  result = []
  for i in sorted(set(a1 + b1)):
    aa1 = [x for x in a1 if x == i]
    bb1 = [x for x in b1 if x == i]
    result += aa1 if len(aa1) < len(bb1) else bb1
  return result

from operator import mul
from functools import reduce

aabb1 = f(aa,bb)

if aabb1 == []:
    aabb1 = [1,1]

aabb = reduce(mul,aabb1)

print(int(a*b/aabb))

Submission status: Accepted

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

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

print(lcm(a, b))

Submission status: Accepted

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


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

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

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

from fractions import gcd

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
i = max(A, B)
B = min(A, B)
A = i
while i <= A*B:
    if i%B == 0:
        print(i)
        exit()
    i += A

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = list(map(int, input().split()))
max = a
if max < b:
  max = b
p = 1
for i in range(b, 1, -1):
  if a % i == 0 and b % i == 0:
    a = a // i
    b = b // i
    p = i
    break
print(a * b * p)

Submission status: Accepted

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

print(lcm(A, B))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import fractions
n = input()    
m = n.split()
p = [int(i) for i in m]
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(p[0], p[1]))

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

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

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

Submission status: Accepted

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

def gcd(x, y):
    m = max(x, y)
    n = min(x, y)
    if m % n == 0:
        return n
    else:
        return gcd(n, m%n)
def lcm(x, y):
    return (x * y) // gcd(x, y)

A , B = tuple(list(map(int, input().split(' '))))
if A == 1 or B == 1:
    print(max(A, B))
else:
    print(lcm(A, B))

Submission status: Accepted

Solution code:
import sys
import fractions

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

a = list(map(int,input().split()))
ans = lcm(a[0], a[1])

print(ans)

Submission status: Accepted

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

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def print_ans(A, B):
    """Test Case
    >>> print_ans(2, 3)
    6
    >>> print_ans(123, 456)
    18696
    >>> print_ans(100000, 99999)
    9999900000
    """
    print(A * B // gcd(A, B))
if __name__ == '__main__':
    # test
    A, B = map(int, input().rstrip().split())
    print_ans(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:
from fractions import gcd

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

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

Submission status: Accepted

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

i = min(A,B)
m = max(A,B)
n = min(A,B)
while 1:
    mt = n
    n = m % n
    m = mt
    if n == 0:
        break
if m != 0:
    print(A*B//m)
else:
    print(A*B)

Submission status: Accepted

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

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
  
S, T=map(int, input().split())
print(lcm(S, T))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
n3=a
n4=b
while(n4!=0):
    n1 = n3
    n2 = n4
    n4 = n1%n2
    n3 = n2
ans = int((a*b)/n2)

print(ans)

Submission status: Accepted

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

 #最大公約数
def max_(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def min_com(a,b):
    return a*b//max_(a,b)
print(min_com(A,B))

Submission status: Accepted

Solution code:
a = list(map(int,input().split())) 
c=1
for i in range(1,min(a[0],a[1])+1):
  if a[0]%i==0 and a[1]%i==0:
    c=i
print(a[0]*a[1]//c)

Submission status: Accepted

Solution code:
import numpy as np
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):
    return int(m*n/gcd(m,n))

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

Submission status: Accepted

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

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

print(int(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:
#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)

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

print(lcm(A,B))

Submission status: Accepted

Solution code:
import math
import fractions

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

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


#print('A = ', A)
#print('B = ', 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 sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
#+++++
import fractions
a,b = map(int, input().split())
#n = int(input().strip())
#s,t=input().split(' ')
ans = a*b//fractions.gcd(a,b)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
m,n=max(a,b),min(a,b)
if m%n==0:
    print(m)
else:
    while m%n!=0 and n!=1:
        m%=n
        m,n=max(m,n),min(m,n)
    print(int(a*b/n))

Submission status: Accepted

Solution code:
# Euclidean Algorithm
import math

def euclid(A,B):
    if A < B:
        A , B = B , A
    quotient = math.floor(A / B)
    surplus = A % B
    if surplus == 0:
        Gretest_common_divisor = B
    else:
        Gretest_common_divisor = euclid(A - B * quotient, B)
    return Gretest_common_divisor

IN = input().split(" ")
A = int(IN[0])
B = int(IN[1])
print(int((A / euclid(A,B)) * B))

Submission status: Accepted

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

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:
# abc148_c.py
from sys import stdin

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
	return a*b//gcd(a,b)
A, B = [int(x) for x in stdin.readline().rstrip().split()]
print(lcm(A,B))

Submission status: Accepted

Solution code:
def gcd(A,B):
    if(A<B):
        tmp=A
        A=B
        B=tmp

    r=A%B

    while(r!=0):
        A=B
        B=r
        r=A%B
        
    return B


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

l = a * b /gcd(a, b)
l = int(l)
print("{}".format(l))

Submission status: Accepted

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

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 as math
A,B = map(int,input().split())
s = 0
l = A
n = B
if B > A :
    A = B
    B = l
while B != 0:
    A, B = B, A%B
    s = A


print(l * n // s)

Submission status: Accepted

Solution code:

a, b = map(int, input().split())
def gcd(l, m):
    x = min(l, m)
    y = max(l, m)
    if y % x == 0:
        return x
    else:
        while y % x != 0:
            z = y % x
            y = x
            x = z
        else:
            return z

def lcm(s, t):
    ans = s * t // (gcd(s, t))
    return ans

print(lcm(a, b))

Submission status: Accepted

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

def prime(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 = sorted(prime(a))
b = sorted(prime(b))

c = set()


def cal(a, b):
    c = set()
    for i in range(len(a)):
        c.add(a[i])
    for i in range(len(b)):
        c.add(b[i])
    ans = []
    e = 1
    for i in range(len(c)):
        d =c.pop()
        if a.count(d) >= b.count(d):
            for j in range(a.count(d)):
                ans.append(d)
        else:
            for j in range(b.count(d)):
                ans.append(d)

    for i in range(len(ans)):
        e *= ans[i]

    return e

print(cal(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:
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:
from fractions import gcd
import sys
sys.setrecursionlimit(100000)

a, b = map(int, input().split())
gcd = gcd(a, b)
if gcd <= 0:
    print(0)
else:
    result = int(a*b / gcd)
    print(result)

Submission status: Accepted

Solution code:

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

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

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

print(int(R))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def conv(s,b):
    j = 1
    sn = s
    bn = b
    i = 2

    while sn != bn :
        bn = b * j
        while sn < bn :
            sn = s*i
            i += 1
        j += 1
    return bn

def main():
    A,B = map(int,input().split())
    if A > B :
        small = B
        big = A
    else :
        small = A
        big = B
    print(conv(small,big))

main()

Submission status: Accepted

Solution code:
import sys
bbn=1000000007
	
#+++++

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

def main():
	a, b = map(int, input().split())
	return a*b//gcd(a,b)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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


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


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

Submission status: Accepted

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

n = max(a,b)
m = min(a,b)

def gcd(n,m):
    l = n % m
    if l == 0:
        return m
    return gcd(m,l)

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

Submission status: Accepted

Solution code:
from fractions import gcd

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


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

Submission status: Accepted

Solution code:
import fractions as fr

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

print(int(lcm(a,b)))

Submission status: Accepted

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

i = A*B
min = 10000000000
for i in range(A):
    if (A*B)%1==0:
        if ((A*B)/(i+1))%A==0 and ((A*B)/(i+1))%B==0:
            min = (A*B)/(i+1)
print(int(min))

Submission status: Accepted

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


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:
input_nums = list(map(int, input().split()))
num1 = input_nums[0]
num2 = input_nums[1]

def gcd(num1, num2):
    a = max(num1, num2)
    b = min(num1, num2)
    r = a%b
    while(r != 0):
        a = b
        b = r
        r = a%b
    return b
    

print(num1 * num2 // gcd(num1, num2))

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

Solution code:
import fractions

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

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

print(int(lcm))

Submission status: Accepted

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

c=a
d=b
e=0
while not min(c,d)==0:
    e=max(c,d)%min(c,d)
    c=min(c,d)
    d=e


print(a*b//c)

Submission status: Accepted

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

A_orgn = A
B_orgn = B
# A = n1 * n2 * n3   , B = n1 * n2 * n5とする
# 答えが n1 * n2 * n3 * n5 

dict_a = {}
dict_b = {}
if A == 1:
    dict_a[1] = 1
  
for i in range(2,int(math.sqrt(A))+1):
    if A % i == 0:
        while(1):
            A //= i
            if i not in dict_a:
                dict_a[i] = 1
            else:
                dict_a[i] += 1
            if A % i != 0:
                break
if A != 1:
    dict_a[A] = 1

if B == 1:
    dict_b[1] = 1
for i in range(2,int(math.sqrt(B))+1):
    if B % i == 0:
        while(1):
            B //= i
            if i not in dict_b:
                dict_b[i] = 1
            else:
                dict_b[i] += 1
            if B % i != 0:
                break
if B != 1:
    dict_b[B] = 1
#print(dict_a)
#print(dict_b)

sum = 1
for i in range(max(A_orgn, B_orgn)+1):
    #print(i)
    if (i not in  dict_a) and ( i in dict_b):
        
        sum *= i ** dict_b[i] 
        #print("====",i, "====",sum)
    elif (i in dict_a) and ( i not in dict_b):
        
        sum *= i ** dict_a[i]
        #print("||||",i, "||||", sum)
    elif (i in dict_a) and ( i in dict_b):
        
        sum *= i ** max(dict_a[i], dict_b[i])
        #print("????",i,"????", sum)
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
import fractions

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

d = input().split(" ")
a = int(d[0])
b = int(d[1])
ans = 1
p = a
if b <= p:
	p = b
for i in range(2, p+1):
	while(a % i == 0 and b % i == 0):
		ans *= i
		a = int(a/i)
		b = int(b/i)
ans = ans * a * b
print(ans)

Submission status: Accepted

Solution code:
import fractions as math

a  = input()
ans = a.split(" ")

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
  
print(lcm(int(ans[0]), int(ans[1])))

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

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

Submission status: Accepted

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

import fractions

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
def gcd(a,b): 
	if a == 0: 
		return b 
	return gcd(b % a, a) 

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

input = input().split(' ')
a = int(input[0])
b = int(input[1])
print(int(lcm(a, b)))

Submission status: Accepted

Solution code:
import fractions

a = input().split()
a = list(map(int, a))
def lcm(x, y):
    return (x * y) // fractions.gcd(x,y)
print(lcm(a[0],a[1]))

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 gojo(m, n):
    return m if n == 0 else gojo(n, m % n)

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

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

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

Submission status: Accepted

Solution code:
N=list(map(int,input().split()))
m=int(N[0])
n=int(N[1])
ans=1
while(ans!=0):
    ans=m%n
    if(ans<n and ans!=0):
        m=n
        n=ans
    else:
        pass
print(int((N[0]*N[1])/n))

Submission status: Accepted

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

for i in range(b,0,-1):
  if (a % i == 0) and (b % i == 0):
    s = int(a * b / i)
    print(s)
    break

Submission status: Accepted

Solution code:
# ABC148 C

import fractions

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

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

Submission status: Accepted

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

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

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

print(Ans)

Submission status: Accepted

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

a =  (input().split())
b = [1, 1]
b[0] = int(a[0])
b[1] = int(a[1])
print(lcm(b))

Submission status: Accepted

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

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

print(multiple(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(a, b):
    while b:
        a, b = b, a % b
    return a

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)
A, B = input().split()
print(lcm(int(A), int(B)))

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
def min2(A,B):
  C = abs(A - B)
  D = [A, B, C]
  D.sort()
  if D[0] == 1:
    return 1
  elif D[0] == D[1]:
    return D[0]
  else:
    return min2(D[0],D[1])
a = min2(A,B)

print(int(A*B/a))

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

temp = lcm(a, b)

print(temp)

Submission status: Accepted

Solution code:
n=input().split(' ')
a=int(n[0]);b=int(n[1])
def gcd(a,b):
    x=max(a,b);y=min(a,b)
    if x%y==0:
        return y
    while x%y!=0:
        z=x%y ; x=y ; y=z
    return z
print(int(a*b/gcd(a,b)))

Submission status: Accepted

Solution code:
N = input()
split = N.split(" ")
A = int(split[0])
B = int(split[1])
max_num = A * B
if A < B:
    tmp = A
    A = B
    B = tmp

r = A % B
while r != 0:
    A = B
    B = r
    r = A % B
max_num /= B 
print(int(max_num))

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

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

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

lcm = lcm(p1, p2)
print(int(lcm))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

def prime_factorize(n):
    # 1に注意
    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())

if a == 1 or b == 1:
    print(a*b)
    exit()

a_dic = collections.Counter(prime_factorize(a))
b_dic = collections.Counter(prime_factorize(b))

target_list = list(set(list(a_dic.keys()) + list(b_dic.keys())))

result = 1

for i in target_list:
    if i in a_dic and i in b_dic:
        value = max(a_dic[i], b_dic[i])
    elif i not in b_dic:
        value = a_dic[i]
    else:
        value = b_dic[i]
    result *= i ** value

print(result)