Problem:


Score : 300 points

Problem Statement

Takahashi is organizing a party.

At the party, each guest will receive one or more snack pieces.

Takahashi predicts that the number of guests at this party will be A or B.

Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.

We assume that a piece cannot be divided and distributed to multiple guests.

Constraints

1 \leq A, B \leq 10^5

A \neq B

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.

Sample Input 1

2 3

Sample Output 1

6

When we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.

Sample Input 2

123 456

Sample Output 2

18696

Sample Input 3

100000 99999

Sample Output 3

9999900000



Sample input:
2 3


Sample output:
6

Submission status: Accepted

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

def gcd(num):
    while (num > 0):
        if (A%num == 0 and B%num == 0):
            return(num)
        num -= 1

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import fractions

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

    f=fractions.gcd(a,b)
    f2=a*b//f
    print(f2)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

min_i = min([a, b])

def calc(n):
  while n > 1:
    if (a % n) == 0 and (b % n) == 0:
      return n
    n -= 1
  return 1

print("{:.0f}".format(a * b / calc(min_i)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x,y=a,b
while y:
  x,y=y,x%y
print(a*b//x)

Submission status: Accepted

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

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

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

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

n,m=input().split(" ")
n=int(n)
m=int(m)
l=lcm(max(m,n),min(m,n))

print((m*n)//l)

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

Submission status: Accepted

Solution code:
import fractions

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

# 最小公約数
gcd = fractions.gcd(A,B)
# 最小公倍数
lcm = int(A*B/gcd)
print(lcm)

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 = [int(x) for x in 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):
  r = A % B
  if(r == 0):
    return B
  else:
    return gcd(B,r)
A, B = list(map(int, input().split()))
A, B = max(A,B), min(A,B)
print(A * B // gcd(A,B))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(lcm)

Submission status: Accepted

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

C = 0

for i in range(B):
  if A * (i+1) % B == 0:
    print(A*(i+1))
    break

Submission status: Accepted

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

count = 1
while True:
    if count*A%B == 0:
        print(count*A)
        break
    else:
        count += 1

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
import numpy as np
import collections

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

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

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

print(ans);

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

Submission status: Accepted

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

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

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 os

def main():
    num_a,num_b = (int(x) for x in input().split())
    num_max = num_a * num_b
    
    if (num_b > num_b):
        num = num_a
        num_a = num_b
        num_b = num

    r = num_a % num_b

    while(r != 0):
        num_a = num_b
        num_b = r
        r = num_a % num_b

    print(int(num_max/num_b))

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

s = A
while s % B != 0:
    s += A
print(s)

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

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

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

Submission status: Accepted

Solution code:
import fractions

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

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
N=min(A,B)
i=X=0

for i in range(N+1,1,-1):
  if A%i==0 and B%i==0:
    X=round(A*B/i)
    break
  else:
    X=round(A*B)

print(X)

Submission status: Accepted

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

import fractions

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

print(int(ans))

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


def Gcd(a, b):
    a, b = max(a, b), min(a, b)
    while b != 0:
        a, b = b, a % b
    return a


ans = A * B / Gcd(A, B)
print(int(ans))

Submission status: Accepted

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

#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)
    
print(lcm(a,b))

Submission status: Accepted

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

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

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

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

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

# %%
# from atcoder_test import doTest
# doTest("abc148","c",main)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
x,y=a,b
while b!=0:
  a,b=b,a%b
print(x*y//a)

Submission status: Accepted

Solution code:
m,n=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(m,n))

Submission status: Accepted

Solution code:
class AC:
    @staticmethod
    def inputStr(char):
        return input().split(char)
    
    @staticmethod
    def inputInt(char):
        a = input().split(char)
        for i in range(len(a)):
            a[i] = int(a[i])
        return a

inp = AC.inputInt(" ")
A = inp[0]
B = inp[1]

X = A*B
tmp = 0

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

def gcd(x,y):
    c=x
    d=y
    if y>x:
        x=d
        y=c
    
    if y == 0:
        return x
    
    else:
        return gcd(y,x%y)
    
print(int((a*b)/gcd(a,b)))

Submission status: Accepted

Solution code:
a,b = map(int,input().split(" "))
x = a
y = b
while True:
    if x == y:
        print(x)
        break
    if x < y:
        x += a
    else:
        y += b

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
def lcm(a, b): # 最小公倍数
    def gcd(a, b): # 最大公約数
        a = abs(a)
        b = abs(b)
        while b:
            a, b = b, a % b
        return a # int
    return a * b // gcd(a, b) # int
print(lcm(A,B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
import fractions
print(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:
def lcm(m: int, n: int) -> int:
    for x in range(m, n * m + 1, m):
        if x % n == 0:
            return x


A, B = [int(x) for x in input().split()]
print(lcm(A, B))

Submission status: Accepted

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

def get_lcm(a, b, gcd=0):
    if gcd == 0:
        return a * b // get_gcd(a, b)
    else:
        return a * b // gcd


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

print(get_lcm(A, B))

Submission status: Accepted

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


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


print(lcm(a, b))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
#最大公約数
def gcd(a,b):#a<=b
    while a != 0:
        a,b = b%a,a
    return 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())


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


print(int(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:
a,b = (int(i) for i in input().split())

import fractions

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# a, bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
# a, bの最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)

print(lcm(a, b))

Submission status: Accepted

Solution code:
#a,bの最小公倍数
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:
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:
"""
ユークリッドの互除法により最大公約数を求めます
int a,b
return int
"""
def divisor(a,b):
    if a < b : #bのほうが大きければ入れ替え
        b += a
        a = b - a
        b -= a

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

"""
最小公倍数を最小公約数から求めます
int a,b
return int
"""
def multiple(a,b):
    c = divisor(a,b)
    return int(a*b/c)

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

print(multiple(a,b))

Submission status: Accepted

Solution code:
import math

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


C = A * B
C_sqrt_int = int(math.sqrt(C))

for i in range(C_sqrt_int):
    while A%(i+2) == 0 and B%(i+2) == 0:
        C = C / (i+2)
        A = A / (i+2)
        B = B / (i+2)


print(int(C))

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:
def compute_gcd(x, y):
   while(y):
       x, y = y, x % y
   return x


inp = input().split()
x = int(inp[0])
y = int(inp[1])

print(int(x*y/compute_gcd(x, y)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

    answer = least_common_multiple(A, B)    
    print(answer)

def least_common_multiple(a, b):
    if b > a:
        a, b = b, a
    
    ab = a*b

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

    return int(ab/b)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

if b > a:
  a, b = b, a

while a % b != 0:
  a, b = b, a%b
 
print(int(ab/b))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcm(a,b):
    if a==0:
        return b
    elif b==0:
        return a
    else: 
        return gcm(a%b,b) if a>=b else gcm(a,b%a)

def lcn(a,b):
    return a*b//gcm(a,b)

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

Submission status: Accepted

Solution code:
a,b =map(int,input().split())
#print(a,b)
c=0
if a>=b:
    i=1
    while a*i%b!=0:
        i+=1
    else:
        c=a*i
else:
    j=1
    while b*j%a!=0:
        j+=1
    else:
        c=b*j
    
print(c)

Submission status: Accepted

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

prime = [2]
for i in range(3, 10**5, 2):
  flag = True
  for j in prime:
    if j > math.sqrt(i):
      break
    if i % j == 0:
      flag = False
      break
  if flag:
    prime.append(i)

a_dict = dict()
b_dict = dict()
used = set()

for i in prime:
  if a < i and b < i:
    break
  while a % i == 0:
    a /= i
    a_dict[i] = a_dict.get(i, 0) + 1
    used.add(i)
  while b % i == 0:
    b /= i
    b_dict[i] = b_dict.get(i, 0) + 1
    used.add(i)

ab = 1
for i in used:
  ad = a_dict.get(i, 0)
  bd = b_dict.get(i, 0)
  n = ad if ad > bd else bd
  ab = ab * (i**n)
  
print(ab)

Submission status: Accepted

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

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

a,b=[int(i) for i in input().split()]
print(lcm(a,b))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=sorted(map(int,input().split()))
for i in range(1,b+1):
	if a*i<b:
		if b%(a*i)==0:
			print(b)
			break
	else:
		if (a*i)%b==0:
			print(a*i)
			break

Submission status: Accepted

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

def lcm(x,y):
    return (x * y) // gcd(x,y)
def gcd(x,y):
    while y != 0:
        x, y = y, x % y
    return x

main()

Submission status: Accepted

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

### GCD ###
def gcd(a, b):
  return gcd(b, a%b) if b else a

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

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

### LCM ###
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())
a , b = 0, 0
ans = 0
n = 1
 
for i in range(1, 100001):
  a = A * i
  if ans != 0:
    print(ans)
    break
  for j in range(n, 100001):
    b = B * j
    if a == b:
      ans = a
    elif b < a:
      continue
    else:
      n = j
      break

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
a , c = 0, 0
ans = 0

if B > A:
  c = B
  B = A
  A = c
 
for i in range(1, B+1):
  a = A * i
  if ans != 0:
    break
  if a % B == 0:
    ans = a
    break
print(ans)

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

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

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

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

import sys
sys.setrecursionlimit(300000)


def solve(A: int, B: int):
    def gcd(a, b):
        return a if b == 0 else gcd(b, a % b)
    ret = A * B // gcd(A, B)
    print(ret)
    return

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:
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#リスト l の最大公約数
def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

#a*x+b*y=gcd(a,b)の一つの解
def extgcd_2(a,b):    
    g = gcd(a,b)
    a = a//g
    b = b//g
    return extgcd(a,b)

#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 sys
def input():
  return sys.stdin.readline()[:-1]

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

Submission status: Accepted

Solution code:
A,B = [int(s) for s in input().split()]

C = 1
delta = 0.00000001
while( C < B ):
  if C*A % B < delta:
    break
  C+=1
  
print(C*A)

Submission status: Accepted

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

def gcd(x, y):
    X = max(x, y)
    Y = min(x, y)

    while True:
        r = X % Y
        X = Y
        Y = r
        if r == 0:
            break
    return X

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

Submission status: Accepted

Solution code:
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

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

#最大公約数
import fractions
a = fractions.gcd(x,y)

#最小公倍数
b = x*y//a

print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
for i in range(max(a,b),0,-1):
  if a%i==0 and b%i==0:
    c=i
    break
print(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:
import fractions

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

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

Submission status: Accepted

Solution code:
import sys
from fractions import gcd

lines = sys.stdin.readlines()

a, b = map(int, lines[0].split())

x = gcd(a, b)

print(x * (a//x) * (b//x))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
f=A
g=B
while f%g != 0:
  f,g = [g, f%g]
print(int(A*B/g))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

print(lcm(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())
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,list( input().split(" ")))
print(lcm(a, b))

Submission status: Accepted

Solution code:
import fractions as frac

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

Submission status: Accepted

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

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

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

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

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

print(x*y//b)

Submission status: Accepted

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

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

Submission status: Accepted

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

if a < b:
  min = a
else:
  min = b
  
c = []
i = 2
while i <= min:
  if a % i == 0 and b % i == 0:
    a //= i
    b //= i
    min //= i
    c += [i]
  else:
    i += 1
    

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

l = n * a * b

print(l)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
n1, n2  = [int(i) for i in input().split()]

n3 = (n1 * n2) //gcd(n1, n2)

print(n3)

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


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


if __name__ == "__main__":
    main()

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)

x,y = map(int,input().split())
ans = (x*y)//gcd(x,y)
print(ans)

Submission status: Accepted

Solution code:

# Beginners Contest (C)

import sys

# 約数に分解
def calc_divisor(n):
	div_dic = {}
	if n == 1: return div_dic
	k = 2
	while True:
		# 約数の場合
		if n%k == 0:
			if k not in div_dic: div_dic[k] = 0
			div_dic[k] += 1
			n = n//k
			if n == 1: break
		else:
			k += 1
	return div_dic

# 入力取得
a,b = [int(e) for e in input().split(" ")]

# 約数に分解
div_dic_a = calc_divisor(a)
div_dic_b = calc_divisor(b)

# 約数の和集合を計算
div_ls = list(div_dic_a) + list(div_dic_b)
div_ls = list({k: 1 for k in div_ls})
div_dic = {k:(div_dic_a[k]
	if div_dic_a.get(k,0) > div_dic_b.get(k,0)
	else div_dic_b[k]) for k in div_ls}
# print(div_dic)

# 最小公倍数を計算
ans = 1
for k in div_dic:
	ans *= k ** div_dic[k]

print(ans)

Submission status: Accepted

Solution code:
import math

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

def find_divisor(n):
    answer = n
    for i in range(math.floor(math.sqrt(n))):
        if n % (i+2) == 0:
            answer = (i+2)
            break
        else:
            pass
    return answer

A_q_list = []
B_q_list = []
A_dict = {}
B_dict = {}
LCM_pq_list = []
LCM_dict = {}

q = A
for i in range(A):
    while q >= 2:
        divisor = find_divisor(q)
        A_q_list.append(divisor)
        try:
            A_dict[divisor]
        except KeyError:
            A_dict[divisor] = 1
            if divisor not in LCM_pq_list:
                LCM_pq_list.append(divisor)
        else:
            A_dict[divisor] += 1
        q = q // divisor
q = B
for i in range(B):
    while q >= 2:
        divisor = find_divisor(q)
        B_q_list.append(divisor)
        try:
            B_dict[divisor]
        except KeyError:
            B_dict[divisor] = 1
            if divisor not in LCM_pq_list:
                LCM_pq_list.append(divisor)
        else:
            B_dict[divisor] += 1
        q = q // divisor

LCM = 1
for i in LCM_pq_list:
    try:
        A_dict[i]
    except KeyError:
        A_dict[i] = 0
    else:
        pass
    try:
        B_dict[i]
    except KeyError:
        B_dict[i] = 0
    else:
        pass
    LCM_dict[i] = max(A_dict[i], B_dict[i])
    LCM = LCM * i**LCM_dict[i]

print(LCM)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a,b = LI()
    g = fractions.gcd(a,b)

    return a*b//g


print(main())

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
N=min(A,B)
gcd=1
for n in range(2,N+1):
    if A%n==0 and B%n==0:
        gcd=n
print(A*B//gcd)

Submission status: Accepted

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

a, b = list(map(int, input().split()))
print(int(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 = tuple(map(int, input().split()))
print(lcm(A, B))

Submission status: Accepted

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