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:
N,M = map(int,input().split())
n,m=N,M
if n<m:
    t=n;n=m;m=t
while n%m:
    t=n%m;n=m;m=t
print(N*M/m)

Submission status: Wrong Answer

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

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

tmp = gcd(max(a,b),min(a,b))

n = a * b * tmp
print(n)

Submission status: Wrong Answer

Solution code:
import platform
import numpy
import scipy

print('Python:', platform.python_version())
print('NumPy: ', numpy.__version__)
print('SciPy: ', scipy.__version__)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
f=a
g=b
if b>=a:
    d=b
    b=a
    a=d
c=a%b
while c!=0:
    c=a%b
    a=b
    b=c

print(f*g/a)

Submission status: Wrong Answer

Solution code:
#C-snack

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

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

if a<b:
    tmp=a
    a=b
    b=tmp

print(a,b)

ans=int(a*b/saidaikouyakusu(a,b))

print(ans)

Submission status: Wrong Answer

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

def getMultiplier(a) : 
    Li = []
    while a > 1 :
        for i in range(2,int(a)+1):
            if a % i == 0 :       
                Li.append(i)
                a = a / i
                break
            else : 
                continue
    return Li

aLi = getMultiplier(a)
bLi = getMultiplier(b)


for x in aLi:
    if x in bLi:
        aLi.remove(x)

for x in bLi:
    if x in aLi:
        bLi.remove(x)

total = aLi + bLi
value = 1

for i in total :
    value *= i 

print(value)

Submission status: Wrong Answer

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

def getMultiplier(a) : 
    Li = []
    while a > 1 :
        for i in range(2,int(a)+1):
            if a % i == 0 :       
                Li.append(i)
                a = a / i
                break
            else : 
                continue
    return Li

aLi = getMultiplier(a)
bLi = getMultiplier(b)

if (aLi.__len__ > bLi.__len__) :
    for x in aLi:
        if x in bLi:
            aLi.remove(x)
else :
    for x in bLi:
        if x in aLi:
            bLi.remove(x)

total = aLi + bLi
value = 1

for i in total :
    value *= i 

print(value)

Submission status: Wrong Answer

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

def getMultiplier(a) : 
    Li = []
    while a > 1 :
        for i in range(2,int(a)+1):
            if a % i == 0 :       
                Li.append(i)
                a = a / i
                break
            else : 
                continue
    return Li

aLi = getMultiplier(a)
bLi = getMultiplier(b)

for x in aLi:
    if x in bLi:
        aLi.remove(x)

total = aLi + bLi
value = 1

for i in total :
    value *= i 

print(value)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = A * B
if A > B:
  for i in range(2, B):
    if ans % i == 0:
      ans == ans / i
elif A < B:
  for j in range(2, A):
    if ans % j == 0:
      ans == ans / j
    
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = A * B
if A > B:
  for i in range(2, B):
    if ans % i == 0:
      ans == ans / i
else:
  for i in range(2, A):
    if ans % i == 0:
      ans == ans / i
    
print(ans)

Submission status: Wrong Answer

Solution code:
num=input().split()
num[0]=int(num[0])
num[1]=int(num[1])
min1=0
if num[0]>=num[1]:
  min1=num[1]
elif num[0]<num[1]:
  min1=num[0]
great_common=1
min2=min1//2
while min1!=1:
  for i in range(min2):
    while min1%(i+2)==0:
      if min1%(i+2)==0:
        min1/=i+2
        great_common*=i+2
print(int(num[0]*num[1]/great_common))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
def gdc(m,n):
  x = max(m,n)
  y = min(m,n)
 
  while x % y != 0:
    z = x//y
    y = x % y
    x = z
  return y
 
def lcm(m,n):
  return int(m * n / gdc(m,n))
 
inputNum = list(map(int, input().split()))
a = inputNum[0]
b = inputNum[1]
 
print(lcm(a,b))

Submission status: Wrong Answer

Solution code:
def gdc(m,n):
  x = max(m,n)
  y = min(m,n)

  while x % y != 0:
    z = x//y
    y = x % y
    x = z
  return y

def lcm(m,n):
  return int(m * n / gdc(m,n))

inputNum = list(map(int, input().split()))
a = inputNum[0]
b = inputNum[1]

print(lcm(a,b))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())  
# Recursive function to return gcd of a and b 
def gcd(a, b):
  if a == 0:
    return b
  return gcd(b % a, a)
 
# Function to return LCM of two numbers 
def lcm(a, b):
  return (a * b) / gcd(a, b)
 
# Driver program to test above function 
print(str(lcm(a, b)))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())  
# Recursive function to return gcd of a and b 
def gcd(a, b):
  if a == 0:
    return b
  return gcd(b % a, a)

# Function to return LCM of two numbers 
def lcm(a, b):
  return (a * b) / gcd(a, b)

# Driver program to test above function 
print(lcm(a, b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
def cud(a,b):
  if a%b==0:
    return b
  else:
    return cud(b,a%b)
print(a[0]*a[1]/cud(a[0],a[1]))

Submission status: Wrong Answer

Solution code:
def yukurid(a,b):
    if a>b:
        a,b = b,a
    while b%a != 0:
        a,b = b%a,a
    return int(a)

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

Submission status: Wrong Answer

Solution code:
A,B=input().split()
a=int(A)
b=int(B)
 
c=min(a,b)
 
def sosu(x):
    sum=0
    for i in range(x):
        if x%(i+1)==0:
            sum+=1
    if sum==2:
        return True
    else:
        return False

j=2  
kobai=[]
while j<=c:
  if a%j==0 and b%j==0 and sosu(j):
    c=int(c/j)
    kobai.append(j)
    #print(j)
    j=2
   
  else:
    j+=1
#print(kobai) 
answer=a*b
for i in range(len(kobai)):
  answer=int(answer/kobai[i])

print(answer)

Submission status: Wrong Answer

Solution code:
A,B=input().split()
a=int(A)
b=int(B)
 
c=min(a,b)
 
def sosu(x):
    sum=0
    for i in range(x):
        if x%(i+1)==0:
            sum+=1
    if sum==2:
        return True
    else:
        return False

j=2  
kobai=[]
while j<=c:
  if a%j==0 and b%j==0 and sosu(j):
    c=int(c/j)
    kobai.append(j)
    print(j)
    j=2
   
  else:
    j+=1
print(kobai) 
answer=a*b
for i in range(len(kobai)):
  answer=int(answer/kobai[i])

print(answer)

Submission status: Wrong Answer

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

c=min(a,b)

def sosu(x):
  for i in range(x):
    sum=0
    if x%(i+1)==0:
      sum+=1
    
    if sum==2:
      return True
    else:
      return False
j=2  
kobai=[]
while j<=c:
  if a%j==0 and b%j==0 and sosu(j):
    c=int(c/j)
    kobai.append(j)
    j=2
   
  else:
    j+=1

answer=a*b
for i in range(len(kobai)):
  answer=int(answer/kobai[i])

print(answer)

Submission status: Wrong Answer

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

v = int((X[0] * X[1]) / 2)

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

print(j)

Submission status: Wrong Answer

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

v = X[0] * X[1]

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

print(j)

Submission status: Wrong Answer

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

BB = []
CB = []

def myfunc(X, XX):
  for num in range(2, X+1):
    if(X%num == 0):
      XX.append(num)
      BA = int(X/num)
      myfunc(BA, XX)
      break

myfunc(B, BB)
myfunc(C, CB)

DB = []

for num1 in BB:
  for num2 in range(len(CB) - 1):
    if num1 == CB[num2]:
      DB.append(num1)
      CB.pop(num2)
      break

BB.extend(CB)

ANSWER = 1

for num in BB:
  ANSWER = num * ANSWER

if(B == C):
  ANSWER = B

print(ANSWER)

Submission status: Wrong Answer

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

BB = []
CB = []

def myfunc(X, XX):
  for num in range(2, X+1):
    if(X%num == 0):
      XX.append(num)
      BA = int(X/num)
      myfunc(BA, XX)
      break

myfunc(B, BB)
myfunc(C, CB)

DB = []

for num1 in BB:
  for num2 in range(len(CB) - 1):
    if num1 == CB[num2]:
      DB.append(num1)
      CB.pop(num2)
      break

BB.extend(CB)

ANSWER = 1

for num in BB:
  ANSWER = num * ANSWER

print(ANSWER)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(A*B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A<B:
    C=A
    A=B
    B=C
c=A%B
d=B
for i in range(100000):
    if c==0:
        break
    else:
        d=c
        c=B%c
S=A*B//d
print(S)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A<B:
    C=A
    A=B
    B=C
c=A%B
d=1
for i in range(100000):
    if c==0:
        break
    else:
        d=c
        c=B%c
S=A*B//d
if A==B:
    print(A)
else:
    print(S)

Submission status: Wrong Answer

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

AB = input().split(" ")
A = int(AB[0])
B = int(AB[1])
a = prime_factorize(A)
b = prime_factorize(B)
a.extend(b)
alist = set(a)
answer = 1
for a in alist:
    answer *= a
print(answer)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
C=A*B
if A<B :
    A,B=B,A
while A%B!=0:
    A,B=B,A%B 
D=C/B
print(D)

Submission status: Wrong Answer

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

import fractions

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)
def lcm(a, b):
    return int((a * b) / gcd(a, b))
a = 1000
b = 9999
print(lcm(a, b))

Submission status: Wrong Answer

Solution code:
x,y = input().split()
a = int(x)
b = int(y)
for i in range(1, 100000):
    if i % a == 0 and i % b == 0:
        m = i
        break
    else:
        pass
print(i)

Submission status: Wrong Answer

Solution code:
x,y = input().split()
a = int(x)
b = int(y)
for i in range(1, 200000):
    if i % a == 0 and i % b == 0:
        m = i
        break
    else:
        pass
print(i)

Submission status: Wrong Answer

Solution code:
x,y = input().split()
a = int(x)
b = int(y)
for i in range(1,200000):
    if i%a == 0 and i%b ==0:
        print("Fookin LCM is: ",i)
        m = i
        break
    else:
        pass

Submission status: Wrong Answer

Solution code:
x,y = input().split()
x = int(x)
y = int(y)
if x < y:
  a = y
  b = x
else:
  a = x
  b = y

while b:
  a, b = b, a % b

print(x*y/a)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
A = 123
B = 456
numberA = 0
numberB = 0
dataA = []
dataB = []
sosuA = []
sosuB = []
flagA = []
flagB = []
i = 1
boc = 0
while i <= A:
    dataA += [i]
    i += 1
i = 1
while i <= B:
    dataB += [i]
    i += 1
n = 1
while n <= A:
    if A == 1:
        sosuA += [n]
        numberA += 1
        break
    if A % n == 0:
        sosuA += [n]
        A = A / n
        numberA += 1
        if n == 1:
            n += 1
    else:
        n += 1
n = 1
while n <= B:
    if B == 1:
        sosuB += [n]
        numberB += 1
        break
    if B % n == 0:
        sosuB += [n]
        B = B / n
        numberB += 1
        if n == 1:
            n += 1
    else:
        n += 1
i = 0
n = 0
rase = 0
while i <= numberA - 1:
    if i != 0 and sosuA[i] == sosuA[i - 1]:
        kai = sosuA[i]
        flagA += [kai]
        i += 1
        n = 0
        continue
    if sosuA[i] == sosuB[n]:
        kai = sosuA[i]
        flagA += [kai]
        n += 1
        rase = 1
        boc = n
        if n == numberB - 1 or numberB:
            i += 1
            n = 0
            rase = 0
            continue
        if i == numberA - 1:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuA[i] != sosuB[n] and n == numberB - 1:
        kai = sosuA[i]
        flagA += [kai]
        if i == numberA - 1:
            break
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
rase = 0
while i <= numberB - 1:
    if i != 0 and sosuB[i] == sosuB[i - 1]:
        kai = sosuB[i]
        flagB += [kai]
        i += 1
        n = 0
        continue
    if sosuB[i] == sosuA[n]:
        kai = sosuB[i]
        flagB += [kai]
        n += 1
        rase = 1
        if n == numberA - 1 or numberA:
            i += 1
            n = 0
            rase = 0
            continue
        if i == numberB - 1:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuB[i] != sosuA[n] and n == numberA - 1:
        kai = sosuB[i]
        flagB += [kai]
        if i == numberB - 1:
            break
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
tuika = []
if len(flagA) >= len(flagB):
    while i <= numberB - 1:
        if sosuB[i] == flagA[n]:
            n += 1
            i += 1
        elif n == numberA - 1:
            kai = sosuB[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuB[i] < sosuA[n]:
            kai = sosuB[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagA += tuika
    ans = 1
    for i in flagA:
        ans = ans * i
    print(ans)
else:
    while i <= numberA - 1:
        if sosuA[i] == flagB[n]:
            n += 1
            i += 1
        elif n == numberB - 1:
            kai = sosuA[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuA[i] < sosuB[n]:
            kai = sosuA[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagB += tuika
    ans = 1
    for i in flagB:
        ans = ans * i
    print(ans)

Submission status: Wrong Answer

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

Solution code:
str = list(map(int, input().split()))
A = str[0]
B = str[1]
A = 2
B = 3
numberA = 0
numberB = 0
dataA = []
dataB = []
sosuA = []
sosuB = []
flagA = []
flagB = []
i = 1
boc = 0
while i <= A:
    dataA += [i]
    i += 1
i = 1
while i <= B:
    dataB += [i]
    i += 1
n = 2
while n <= A:
    if A % n == 0:
        sosuA += [n]
        A = A / n
        numberA += 1
    else:
        n += 1
n = 2
while n <= B:
    if B % n == 0:
        sosuB += [n]
        B = B / n
        numberB += 1
    else:
        n += 1

i = 0
n = 0
rase = 0
while i <= numberA - 1:
    if i != 0 and sosuA[i] == sosuB[boc]:
        kai = sosuA[i]
        flagA += [kai]
        i += 1
        n = 0
        continue
    if sosuA[i] == sosuB[n]:
        kai = sosuA[i]
        flagA += [kai]
        n += 1
        rase = 1
        boc = n
        if i == numberA - 1:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuA[i] != sosuB[n] and n == numberB - 1:
        kai = sosuA[i]
        flagA += [kai]
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
while i <= numberB - 1:
    if i != 0 and sosuB[i] == sosuA[boc]:
        kai = sosuB[i]
        flagB += [kai]
        i += 1
        n = 0
        continue
    if sosuB[i] == sosuA[n]:
        kai = sosuB[i]
        flagB += [kai]
        n += 1
        rase = 1
        boc = n
        if i == numberB - 1:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuB[i] != sosuA[n] and n == numberA - 1:
        kai = sosuB[i]
        flagB += [kai]
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
tuika = []
if len(flagA) >= len(flagB):
    while i <= numberB - 1:
        if sosuB[i] == flagA[n]:
            n += 1
            i += 1
        elif n == numberA - 1:
            kai = sosuB[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuB[i] < sosuA[n]:
            kai = sosuB[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagA += tuika
    ans = 1
    for i in flagA:
        ans = ans * i
    print(ans)
else:
    while i <= numberA - 1:
        if sosuA[i] == flagB[n]:
            n += 1
            i += 1
        elif n == numberB - 1:
            kai = sosuA[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuA[i] < sosuB[n]:
            kai = sosuA[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagB += tuika
    ans = 1
    for i in flagB:
        ans = ans * i
    print(ans)

Submission status: Wrong Answer

Solution code:
str = list(map(int, input().split()))
a = str[0]
b = str[1]
i = 1
if a < b:
  big = b
  small = a
else:
  big = a
  small = b

while i != 0:
  i = big % small
  big = small
  small = i

print (a*b/big)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

# 計算量は高々小さい数字であるので、ここでは小さい数字までで計算するようにしている。
if a > b:
    c = b  # 小さい方がc
    d = a
else:
    c = a
    d = b

for i in range(1, c):
    if (d * i) % c == 0:
        print(d * i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
li = []
for i in range(1, 10**5+1):
  if a%i==0 and b%i==0:
    li.append(i)
print((a*b)/li[-1])

Submission status: Wrong Answer

Solution code:
import fractions
a,b=(int(x) for x in input().split())
c = int(fractions.gcd(a, b))
ans = 0
if c == 1:
  if a > b:
    c = b
  else:
    c = a
if a > b:
  ans = a * c
else:
  ans = b * c
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split());print(int(a*b/3 if a%3 == b%3 == 0 else a*b))

Submission status: Wrong Answer

Solution code:
def tot(x,y):
	if x>y:
		z=x*2
		while z%y!=0:
			z*=2
		return z
	else:
		z=y*2
		while z%x!=0:
			z*=2
			return z

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n,m =map(int,input().split())
n2=max(n,m)
m2=min(n,m)
while m2!=0:
    tmp=n2
    n2=m2
    m2=tmp%m2
print(n2,m2)
print(int(n*m/n2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if A % B == 0 :
  if A > B :
    print(B)
  else:
    print(A)

    exit()

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

a, b = list(set(prime_factorize(A))), prime_factorize(B)

X = []
for i in range(0,len(a)):
  for j in range(0,len(b)):
    if a[i] == b[j] :
      X.append(b[j])

Y=list(set(a)^set(b))
Z = X + Y

ans = 1
for i in range(0,len(Z)):
  ans = ans * Z[i]
  
print(ans)

Submission status: Wrong Answer

Solution code:
input_nums = input().split(" ")
input_num_a = int(input_nums[0])
input_num_b = int(input_nums[1])

num_max = max(input_num_a, input_num_b)
num_min = min(input_num_a, input_num_b)

if num_max % num_min == 0:
    print(input_num_a * input_num_b / num_max)
else:
    while num_max % num_min != 0:
        z = num_max % num_min
        num_max = num_min
        num_min = z
    else:
        print(int(input_num_a * input_num_b / z))

Submission status: Wrong Answer

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

divisorA = []
CM = []

stop = 1
for i in range(A):
  if(i+1==A/stop):
    break
  if(i+1==1 or i+1==A):
    continue
  if(A%(i+1)==0):
    divisorA.append(i+1)
    print(i+1)
    stop = i+1

for i in range(len(divisorA)):
  if(B%divisorA[i]==0):
    CM.append(divisorA[i])
    
LCM = A*B
for i in range(len(CM)):
  LCM = LCM/CM[i]

print(int(LCM))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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


maxCalc = int(math.sqrt(max(ints[0],ints[1])))

output = ints[0] * ints[1]


def getDivsor(a, b, commonDivisors):
    for i in range(maxCalc + 1):
        if i > 1:
            if a % i == 0:
                if b % i == 0:
                    output / i
        else:
            pass


print(output)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



for i in range(1,1000000000,1):
  if A > B:
  	C = A * i
  else:
    C = B *i
    
  if C % B == 0:
    print(C)
    break

Submission status: Wrong Answer

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



for i in range(1,1000000,1):
  if A > B:
  	C = A * i
  else:
    C = B *i
    
  if C % B == 0:
    print(C)
    break

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
  x=int(max(a,b))
  y=int(min(a,b))
  if x%y==0:
    return y
  else:
    while x%y!=0:
      z=x%y
      x=y
      y=z
    else:
      return z
    
a,b = map(int, input().split())
if a<b:
  L=a
  S=b
  print((a*b)/gcd(L,S))
elif a>b:
  L=b
  S=a
  print((a*b)/gcd(L,S))
else:
  print(a)

Submission status: Wrong Answer

Solution code:
str = input()
str = str.split()
m = int(str[0])
n = int(str[1])
mn = m * n
temp = 0
while(m % n != 0):
  temp = n
  n = m % n
  m = temp
if n == int(str[1]) or n == int(str[0]):
  n = 1
ans = mn / n
print(int(ans))

Submission status: Wrong Answer

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

print(str(x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = input()
str = str.split()
m = int(str[0])
n = int(str[1])
mn = m * n
temp = 0
while(m % n != 0):
  temp = n
  n = m % n
  m = temp
if n == int(str[1]) or n == int(str[0]):
  n = 1
print(n)
ans = mn / n
print(int(ans))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ma = max(A, B)
mi = min(A, B)
l = ma
for i in range(0, 10**5// ma):
  if l % mi == 0:
    print(l)
    break
  else:
    l += ma

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
C=1
if A<=B:
    if B%A==0:
        print(B)
    else:
        for k in range(2,int(B**(1/2)+2)):
            if A%k==0 and B%k==0:
                A=A/k
                B=B/k
                C=int(A*B*k)
                while True:
                    if A%k==0 and B%k==0:
                        A=A/k
                        B=B/k
                        C=int(A*B*k)
                    else:
                        break
        if C==1:
            C=int(A*B)
        print(C)
else:
    if A%B==0:
        print(A)
    else:
        for k in range(2,int(A**(1/2)+2)):
            if A%k==0 and B%k==0:
                A=A/k
                B=B/k
                C=int(A*B*k)
                while True:
                    if A%k==0 and B%k==0:
                        A=A/k
                        B=B/k
                        C=int(A*B*k)
                    else:
                        break
        if C==1:
            C=int(A*B)
        print(C)

Submission status: Wrong Answer

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

if A % B == 0 :
  if A > B :
    print(B)
  else:
    print(A)

    exit()

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

a, b = prime_factorize(A), prime_factorize(B)
X = list(set(a)&set(b))
Y = a + b

ans=1
for i in range(0,len(Y)):
  ans = ans * Y[i]
for i in range(0,len(X)):
  ans = ans / X[i]
print(int(ans))

Submission status: Wrong Answer

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

p = 2


if A > B:
    for y in range(100000000):
        e = (A * p) % B
        o = (A * p)
        if e == 0:
            print(int(o))
            break
        else:
            p += 1
else:
    for r in range(100000000):
        e = (B * p) % A
        o = (B * p)
        if  e == 0:
            print(int(o))
            break
        else:
            p += 1

Submission status: Wrong Answer

Solution code:
N,S = map(int, input().split())
tmp = 1
a = 1
while True:
  if N // 2 < a or S // 2 < a:
    break
  if N % a == 0 and S % a == 0:
    N,S = N // a, S // a
    tmp *= a
    a = 1
  a += 1

print(tmp * S * N)

Submission status: Wrong Answer

Solution code:
N,S = map(int, input().split())
tmp = 1
a = 1
while True:
  if N % a == 0 and S % a == 0:
    N,S = N // a, S // a
    tmp *= a
    a = 1
  a += 1
  if N // 2 < a or S // 2 < a:
    break
print(tmp * S * N)

Submission status: Wrong Answer

Solution code:
N,S = map(int, input().split())
tmp = 1
a = 1
while True:
  if N % a == 0 and S % a == 0:
    N,S = N // a, S // a
    tmp *= a
    a = 1
  a += 1
  if N // 2 <= a or S // 2 <= a:
    break
print(tmp * S * N)

Submission status: Wrong Answer

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

p = 2


if A > B:
    for y in range(100000):
        e = (A * p) % B
        o = (A * p)
        if e == 0:
            print(int(o))
            break
        else:
            p += 1
else:
    for r in range(100000):
        e = (B * p) % A
        o = (B * p)
        if  e == 0:
            print(int(o))
            break
        else:
            p += 1

Submission status: Wrong Answer

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

p = 2


if A > B:
    # print('Aに行きました')
    # print(A)
    for y in range(100000):
        e = (A * p) % B
        o = (A * p)
        # print(e)
        # print(o)
        if e == 0:
            print(int(o))
            break
        else:
            p += 1
else:
    # print('Bに行きました')
    # print(B)
    for r in range(100000):
        print('----'+ str(r))
        e = (B * p) % A
        o = (B * p)
        # print(e)
        # print(o)
        if  e == 0:
            print(int(o))
            break
        else:
            p += 1

Submission status: Wrong Answer

Solution code:
N,S = map(int, input().split())
tmp = 1
a = 2
while True:
  if N % a == 0 and S % a == 0:
    N,S = int(N // a), int(S // a)
    tmp *= a
    a = 1
  a += 1
  if N // 2 <= a or S // 2 <= a:
    break
print(tmp * S * N)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A//B==0:
  print(A*B//2)
elif A*B//3==0:
  print(A*B//3)
elif A*B//5==0:
  print(A*B//5)
elif A*B//7==0:
  print(A*B//7)
elif A*B//11==0:
  print(A*B//11)
elif A*B//13==0:
  print(A*B//13)
else:
  print(A*B)

Submission status: Wrong Answer

Solution code:
A,B = (int(x) for x in input().split())
if A%2==0:
  a=A//2
else:
  a=(A+1)//2  

d=1
s=0
d=int(d)
for i in range(a): 
  if A%d==0 and B%d==0:
    s=d
  d+=1
if s==1 :
  print(int(A*B))
elif s==0:
  print(int(A*B))

else:
  print(int(A*(B/s)))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A//B==0:
  print(A*B//2)
elif  A//B==0:
  print(A*B//3)
else:
  print(A*B)

Submission status: Wrong Answer

Solution code:
A,B = (int(x) for x in input().split())
if A%2==0:
  a=A//2
else:
  a=(A+1)//2  

d=1
s=0
d=int(d)
for i in range(a): 
  if A%d==0 and B%d==0:
    s=d
  d+=1
if s==1:
  print(int(A*B))
else:
  print(int(A*(B/s)))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A//B==0:
  print(A*B//2)
else:
  print(A*B)

Submission status: Wrong Answer

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


def main():
    A, B = [int(_) for _ in input().split()]

    product = A * B
    for divisor in range(min([A, B]) // 2, 2, -1):
        if A % divisor == 0 and B % divisor == 0:
            A = A // divisor
            B = B // divisor
            product = product // divisor

    print(product)


if __name__ == "__main__":
    main()