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: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

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

fb = factorization(B)

ans = A
for b, n in fb:
  for i in range(n, 0, -1):
    if ans % (b**n) == 0:
      break
    else:
      ans *= (b**n)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,max(a,b)):
    if (a%i==0 and b%i==0):
        gcc*=i
        a/=i
        b/=i

print(int(a*b/gcc))

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b = INTM()
    c =min(a,b)
    d=max(a,b)
    if d%c ==0:
        print(int(d))
    else:
        while d%c!=0:
            e = d%c
            d = c
            c = e
            print(e)
        print(int(a*b/e))
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:

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


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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
s = a*b
m = min(a,b)

for i in range(s,10**10+1,m):
    if i%a == 0 and i%b ==0:
        print(i)
        exit()

Submission status: Wrong Answer

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

for i in range(1,max(a,b)):
    if (a%i==0 and b%i==0):
        gcc*=i

print(int(a*b/gcc))

Submission status: Wrong Answer

Solution code:
from functools import reduce
from fractions import gcd

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

Submission status: Wrong Answer

Solution code:
import fractions

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

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

i = max(A, B)

while True:
  
  if i % A == 0 and i % B == 0:
    print(i)
    exit()
    
  i += 1

Submission status: Time Limit Exceeded

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

i = 1

while True:
  
  if i % A == 0 and i % B == 0:
    print(i)
    exit()
    
  i += 1

Submission status: Time Limit Exceeded

Solution code:

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

if a>b:
    c = a
else: c = b

while(True):
    if((c%a==0)and(c%b==0)):
        lcm = c
        break
    c+=1
print(lcm)

Submission status: Time Limit Exceeded

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

minimum = max(A,B)

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

Submission status: Time Limit Exceeded

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

minimum = max(A,B)

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

Submission status: Time Limit Exceeded

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

while A != B:
    if A > B:
        A, B = B, A
    A += A

print(A)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

m = a*b
lst = []
for i in range(1, b+1):
  if m < a*i:
    break
  lst.append(a*i)

for j in range(1, a+1):
  if j*b in lst:
    print(j*b)
    break

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b = map(int,input().split())
ans = max(a,b)
while True:
    if ans % a == 0 and ans % b == 0:
        print(ans)
        break
    ans += 1

Submission status: Time Limit Exceeded

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

for i in range(max(A,B),A*B+1):
    if i%A==0 and i%B==0:
        print(i)
        break
    i+=(min(A,B)-1)

Submission status: Time Limit Exceeded

Solution code:
A,B = map(int, input().split())
max = A * B
lst = []
lst.append(max)

for i in range(max,0,-1):
    if (i % A == 0) and (i % B == 0):
        lst.append(i)
print(min(lst))

Submission status: Time Limit Exceeded

Solution code:

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

snack = max([A, B])
while snack % A != 0 or snack % B != 0:
    snack += 1

print(snack)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math
import sys
input = sys.stdin.readline
a,b=map(int,input().split())
for i in range(1, a*b +1):
  if i%a == 0 and i%b == 0:
    print(i)
    break

Submission status: Time Limit Exceeded

Solution code:
A, B = map(int,input().split())
for i in range(max(A,B),1000000001):
    if i%A==0 and i%B==0:
        print(i)
        break

Submission status: Time Limit Exceeded

Solution code:
from math import sqrt
a,b=map(int,input().split())
c=a*b
for i in range(1,int(sqrt(max(a,b)))):
  while a%i==0 and b%i == 0:
    c=c/i
    
print(c)

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int,input().split())
n = 1
while n < a * b:
  if (n % a == 0) & (n % b == 0):
    break
  n += 1
print(n)

Submission status: Time Limit Exceeded

Solution code:
import math
import sys
sys.setrecursionlimit(10**10000000000000000000000000000000000000)
a,b = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
if b != 0:
    print(lcm(a, b))
else:
    print(a)

Submission status: Time Limit Exceeded

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

ok = False
count = min(nums)
while not ok:    
    if  (count % nums[0] == 0) and (count % nums[1] == 0):
        ok = True
        break
    count += 1
print(count)

Submission status: Time Limit Exceeded

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

ok = False
count = 1
while not ok:    
    if  (count % nums[0] == 0) and (count % nums[1] == 0):
        ok = True
        break
    count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
Al = input().split(' ')
#B = int(input().split(' '))
for i in range(len(Al)):
  A = int(Al[0])
  B = int(Al[1])
sum = 1
while 1:
    A_d = sum % A 
    B_d = sum %B 
    if A_d == 0 and B_d==0:
        break
    else:
        sum = sum+1
print(sum)

Submission status: Time Limit Exceeded

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

i = max(a, b)
while True:
    if i%a == 0 and i%b == 0:
        print(i)
        break
    else: i += 1

Submission status: Time Limit Exceeded

Solution code:
a, b = map(int, input().split())
okashi = 1
max = 10**9
for i in range(0,max):
  if okashi%a == 0 and okashi%b == 0:
    break
  else:
    okashi +=1
print(okashi)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

answer = max(A, B)
while True:
    if answer % A == 0 and answer % B  == 0:
        break
    answer += 1

print(answer)

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
l=[]
for x in range(1,a*b+1):
  if x%a==0 and x%b==0:
    l.append(x)
print(min(l))

Submission status: Time Limit Exceeded

Solution code:
c=input().split(" ")

a=int(c[0])
b=int(c[1])

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

Submission status: Time Limit Exceeded

Solution code:
num1, num2 = map(int, input().split())

n = max(num1, num2)
while(1):
  if n%num1==0 and n%num2==0:
    print(n)
    exit()
  n += 1

Submission status: Time Limit Exceeded

Solution code:
A,B = map(int,input().split())
i = 0
while True:
    i1 = i + 1
    if i1 % A == 0 and i1 % B == 0:
        print(i1)
        break
    i += 1

Submission status: Time Limit Exceeded

Solution code:
a, b = map(int,input().split())
lim = a * b +1
for i in range(min(a,b),lim):
    if i % a == 0 and i % b == 0:
        print(i)
        quit()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int,input().split())
maximum_num = max(a,b)
flag = 1
def equal_divide(x):
    equal = 1
    if x%a==0:
        if x%b==0:
            equal=0
    return equal

while (flag):
    flag = equal_divide(maximum_num)
    maximum_num+=1
print(maximum_num-1)

Submission status: Time Limit Exceeded

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

def lcm(x, y):
 
   #  获取最大的数
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
print(lcm(a,b))

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
A,B = list(map(int,input().split()))
if A == 1:
  print(B)
  exit()
if B == 1:
  print(A)
  exit()
C = A*B
D = []
for i in range(C,1,-1):
  if A % i == 0 and B % i == 0:
    D.append(i)
    A = A // i
    B = B // i
    C = A*B
if len(D) != 0:
  p = np.prod(D)
  C = C*p
print(C)

Submission status: Time Limit Exceeded

Solution code:
def lcm(x,y):
    for i in range(1,10**9):
        if i%x==0:
            if i%y==0:
                return(i)
                break

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

Submission status: Time Limit Exceeded

Solution code:

def lcm(x,y):
    for i in range(1,10**10):
        if i%x==0:
            if i%y==0:
                return(i)
                break

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

Submission status: Time Limit Exceeded

Solution code:
A, B = map(int, input().split())
i = 1
while True:
    j, k = divmod(i, A)
    l, m = divmod(i, B)
    if not k and not m:
        break
    i += 1
print(i)

Submission status: Time Limit Exceeded

Solution code:
n = input()

a, b = n.split()

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

flag = False
for i in range(a):
    if flag:
        break
    for j in range(b):
        if (((i+1) * (j+1)) % a) == 0 and (((i+1) * (j+1)) % b) == 0:
            print((i+1) * (j+1))
            flag = True
            break

Submission status: Time Limit Exceeded

Solution code:
A, B = map(int, input().split())
l = []
for i in range(1, A * B + 1):
    if i % A == 0 and i % B == 0:
        l.append(i)
print(min(l))

Submission status: Time Limit Exceeded

Solution code:
x,y = map(int,input().split())
ans=x*y
for i in range(1,ans+1):
    if(i%x==0 and i%y==0):
        break;
print('%i'%i)

Submission status: Time Limit Exceeded

Solution code:
A,B = map(int,input().split())
greater = max(A,B)
lcm = 0
while(True):
    if((greater % A == 0) and (greater % B == 0)):
        lcm = greater
        break
    greater += 1
print(greater)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

while True:
    if ans % a == 0 and ans % b == 0:
        print(ans)
        break
    ans+=1

Submission status: Time Limit Exceeded

Solution code:
inp = [int(o) for o in input().split(" ")]
n = 0

while True:
  n += 1
  if n % inp[0] != 0:
    pass
  elif n % inp[1] != 0:
    pass
  else:
    break
print(n)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def lcm(x, y):
  greater = max(x, y)
  
  while True:
    if (greater % x == 0) and (greater % y == 0):
      lcm = greater
      break
    
    greater += 1
          
  return lcm

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

print(lcm(a, b))

Submission status: Time Limit Exceeded

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


C = A * B

for i in range(C):
    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: Time Limit Exceeded

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

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

a_dict = dict()
b_dict = dict()

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
  while b % i == 0:
    b /= i
    b_dict[i] = b_dict.get(i, 0) + 1

ab = 1
for i in prime:
  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: Time Limit Exceeded

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

for i in range(1, 100000):
  a = A * i
  if ans != 0:
    print(ans)
    break
  for j in range(1, 100000):
    b = B * j
    if a == b:
      ans = a
    elif b < a:
      continue
    else:
      break

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
A, B = map(float, input().split())
y = False
z = 1
while y == False:
  if  z % A != 0 or z % B != 0:
    z += 1
  else:
    y = True
print(z)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
A, B = map(float, input().split())
y = False
z = 1
while y == False:
  if  z % A != 0 or z /B != 0:
    z += 1
  else:
    y = True
print(z)

Submission status: Time Limit Exceeded

Solution code:

# Beginners Contest (C)

import sys
sys.setrecursionlimit(10**6)

# 約数に分解
def calc_divisor(n):
	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: Time Limit Exceeded

Solution code:
a, b = map(int, input().split()) 
 
count = 1
an = []
bn = []
eee = min(a,b)
 
for ii in range(1, eee+2):
    bbb = b * ii
    bn.append(bbb)
 
while True:
    aaa = a * count
    
    if aaa in bn:
        print(aaa)
        break
    count += 1

Submission status: Time Limit Exceeded

Solution code:
A, B = map(int, input().split())
 
while A!=B:
  if A < B:
    A += A
  else:
    B += B
 
print(A)

Submission status: Time Limit Exceeded

Solution code:
a, b = map(int,input().split())
def min_multi(x,y):
    for i in range(1,y+1):
        for j in range(1,x+1):
            if x*i == y*j:
                return x*i
print(min_multi(a,b))

Submission status: Time Limit Exceeded

Solution code:
# 値の入力
A,B=map(int,input().split())

result=1    # 結果

# 値の判定
while True:
    # AとB人の人数で割り切れた場合、処理を抜ける
    if (result%A==0) and (result%B==0):
        break
    result+=1

print(result)

Submission status: Time Limit Exceeded

Solution code:
def lcm(n,m):
  ma=max(n,m)
  while True:
    if (ma%n==0 and ma%m==0):
      return ma
    ma=ma+1
n,m=map(int,input().split())
print(lcm(n,m))

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int, input().split())
ans = max([a,b])
while True:
    if (ans%a + ans%b) == 0:
        print(ans)
        break
    ans += 1

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int, input().split())
ans = 1
while True:
    if (ans%a + ans%b) == 0:
        print(ans)
        break
    ans += 1

Submission status: Time Limit Exceeded

Solution code:
A , B = input().split(" ")
num1 = int(A)
num2 = int(B)
lcm = num1 if(num1 > num2) else num2
while(True):
    if((lcm % num1 == 0) and (lcm % num2 == 0)):
        print(lcm)
        break
    lcm += 1

Submission status: Time Limit Exceeded

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

def compute_lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
   return lcm

print(compute_lcm(a, b))

Submission status: Time Limit Exceeded

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

min = False
i = 1
while(not min):
    if i%a == 0 and i%b == 0:
        min = True
        break
    i += 1

print(i)

Submission status: Time Limit Exceeded

Solution code:
def LCM(a,b):
  i = 2
  num_line_1 = [a]
  num_line_2 = [b]
  while(1):  
    num_line_1.append(num_line_1[0] * i)
    num_line_2.append(num_line_2[0] * i)
    
    for j in range(i):
      if num_line_1[j] in num_line_2:
        return num_line_1[j]        
    i += 1

num_line = [int(i) for i in input().split(" ")]
print(LCM(num_line[0], num_line[1]))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

def compute_lcm(x, y):

   # choose the greater number
   if x > y:
       greater = x
   else:
       greater = y

   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1

   return lcm

print(compute_lcm(a,b))

Submission status: Time Limit Exceeded

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

if(a > b):
  min1 = a
else:
  min1 = b
while(1):
  if(min1%a == 0 and min1%b == 0):
    print(min1)
    break
    min1 = min1+1

Submission status: Time Limit Exceeded

Solution code:
X = [int(x) for x in input().split()]

if X[0] > X[1]:
    v = X[0]
else:
    v = X[1]

while True:
    if (v % X[0] == 0) and (v % X[1] == 0):
        j = v
        break
    v += 1

print(j)

Submission status: Time Limit Exceeded

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

if A > B:
  tmp = B
  B = A
  A = tmp
  
i = 1
while True:
  if (A*i) % B == 0:
    print(A*i)
    break

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
def sosu(num):
  num2 = num;
  list = [];
  i = 1;
  while i <= num:
    if num2%i is 0:
      list.append(i)
      num2 = num2 // i
      if num2 is 1:
        return list
      else:
        i += 1

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

yaku_a = sosu(a)
yaku_b = sosu(b)

for i in range(len(yaku_a)):
  if yaku_a[i] in yaku_b:
    yaku_b.remove(yaku_a[i])

    marged = yaku_a + yaku_b
    candy = 1;
    for i in range(len(marged)):
      candy = candy * marged[i];
      print(candy)

Submission status: Time Limit Exceeded

Solution code:

def sosu(num):
	num2 = num;
	list = [];
	i = 1;
	while i <= num:
		if num2%i is 0:
			list.append(i)
			num2 = num2 // i
			if num2 is 1:
				return list
		else:
			i += 1

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

if a is 1:
	print(b)
elif b is 1:
	print(a)
else:
	yaku_a = sosu(a)
	yaku_b = sosu(b)

	for i in range(len(yaku_a)):
		if yaku_a[i] in yaku_b:
			yaku_b.remove(yaku_a[i])

	marged = yaku_a + yaku_b
	candy = 1;
	for i in range(len(marged)):
		candy = candy * marged[i];
	print(candy)

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int,input().split())
c = a*b
d = 1
ans  = 0
while d%a != 0 or d%b != 0:
    for i in range(2,c+1):
        if b%c != 0:
            b = b*i
        
print(d)

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int,input().split())
c = a*b
d = 1
ans  = 0
while d%a != 0 or d%b != 0:
    for i in range(1,c+1):
        if b%c != 0:
            d = d+1
        
print(d)

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int,input().split())
c = a*b
d = 1
ans  = 0
while d%a != 0 or d%b != 0:
    for i in range(1,c+1):
        if d%a != 0 or d%b != 0:
            d = d+1
        
print(d)

Submission status: Time Limit Exceeded

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

tf = True
for i in range(2, min(A,B)):
    if A%i == 0 and B%i == 0:
        break
else:
    print(A*B)
    tf = False
    
for i in range(max(A,B), A*B+1):
    if tf is False: 
        break
    if (i >= A and i%A == 0) and (i >= B and i%B == 0):
        print(i)
        break

Submission status: Time Limit Exceeded

Solution code:
a=input().split()
A=int(a[0])
B=int(a[1])
li=[2]
li2=[]
p=0
if B>A:
    c=A
    A=B
    B=c
for i in range(3,A+1):
    for j in range(2,i+1):
        if j==i:
            li.append(i)
        if i%j==0:
            break
while p==0:
    for s in li:
        if A%s==0 and B%s==0:
            A/=s
            B/=s
            li2.append(s)
            break
        if A%s==0 and B%s!=0:
            A/=s
            li2.append(s)
            break
        if A%s!=0 and B%s==0:
            B/=s
            li2.append(s)
            break
        if s==li[-1]:
            p=1
n=1
for m in li2:
    n*=m
print(n)

Submission status: Time Limit Exceeded

Solution code:
def lcm(x, y):
   """This function takes two
   integers and returns the L.C.M."""

   # choose the greater number
   if x > y:
       greater = x
   else:
       greater = y

   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1

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

Submission status: Time Limit Exceeded

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

# 最小公倍数を計算すれば良い。
def gcd(x,y):
  if a < b:
    c = a
  elif a > b:
    c = b
  else:
    c = a
  pro = 1
  for i in range(2,c):
    X = x
    Y = y
    while x % i == 0 and y % i == 0:
      pro = pro * i
      X = X // i
      Y = Y // i
  return pro

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

Submission status: Time Limit Exceeded

Solution code:
get = list(map(int, input().split()))
A = get[0]
B = get[1]
lg = max(A, B)
sm = min(A, B)
for i in range(2, sm + 1):
  while(A % i == 0 and B % i == 0):
    lg = lg / i
ans = lg * sm
print(int(ans))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
A, B = map(int, input().split())
pn = [2]
C = max(A, B)
for i in range(3, C+1):
  flag = 0
  for k in pn:
    if(i%k == 0):
      flag = 1
      break
  if(flag == 0):
    pn.append(i)
#print(pn)

N = len(pn)
aa = np.zeros(N)
bb = np.zeros(N)
As = A
Bs = B
for k in range(N):
  flag = 1
  count = 0
  while(flag == 1):
    if(As % pn[k] == 0):
      As = As // pn[k]
      count += 1
    else:
      flag = 0
  aa[k] = count

  flag = 1
  count = 0
  while(flag == 1):
    if(Bs % pn[k] == 0):
      Bs = Bs // pn[k]
      count += 1
    else:
      flag = 0
  bb[k] = count

ans = 1
for k in range(N):
  ans *= pn[k] ** max(aa[k], bb[k])

print(int(ans))

Submission status: Time Limit Exceeded

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

total =min(A, B)

while True:
    if total %A ==0 and total %B ==0:
        ans = total
        break
    else:
        total +=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
x,y = map(int,input().split())
if x > y:
    greater = x
else:
    greater = y
while(True):
    if((greater % x == 0) and (greater % y == 0)):
        lcm = greater
        break
    greater += 1
print(lcm)

Submission status: Time Limit Exceeded

Solution code:
import sys

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

    for i in range(1, 9999900000):
        if(i%A==0 and i%B==0):
            print(i)
            sys.exit()
main()

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
a, b = map(int,stdin.readline().split())
greater = max(a,b)
while(True):
    if (greater % a == 0) and (greater % b == 0):
        lcm = greater
        break
    greater += 1
print(lcm)

Submission status: Time Limit Exceeded

Solution code:
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
   return lcm

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

i = min(A,B)
while 1:
    if i % A ==0 and i % B == 0:
        print(i)
        break
    else:
        i = i + 1

Submission status: Time Limit Exceeded

Solution code:
num_list = [int(i) for i in input().split()]

result = 0

max = num_list[0] * num_list[1]
for i in range(1, max + 1):
    amari_1 = i % num_list[0]
    amari_2 = i % num_list[1]
    if amari_1 == 0 and amari_2 == 0:
        result = i
        break

print(result)

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
def lcm(x, y):
 
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
print(lcm(a,b))

Submission status: Time Limit Exceeded

Solution code:
a,b = map(int, input().split())
i = max(a,b)
s = 0
while(i <= a*b):
    if (i%a == 0 and i%b == 0):
        s = i
        break
    i += 1
print(i)

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
tem=max(a,b)
while 1:
    if tem%a==0  and tem%b==0:
        print(tem)
        break
    else:
        tem+=1

Submission status: Time Limit Exceeded

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

for i in range(s, a*b+1):
    if i % a  == 0 and  i % b == 0:
        break

print(i)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import gcd

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

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

Submission status: Accepted

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

def get_GCD(x, y):
    if x > y:
        x, y = y, x
    y_ = y
    while True:
        if y % x == 0:
            break
        else:
            y += y_
    return y

print(get_GCD(a, b))

Submission status: Accepted

Solution code:
import math

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

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

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

a, b=(int(x) for x in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def L():
    return list(map(int, input().split()))

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

[a,b]=L()

print(lcm(a, b))

Submission status: Accepted

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

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

print(lcm(a,b))

Submission status: Accepted

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

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

print(lcm(a, b))

Submission status: Accepted

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