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 main():
	A,B = map(int, input().split())
#	A,B = max(A,B), min(A,B)
	G = gcd(A,B)
	# G:最大公約数, L:最小公倍数
	# AB=GL
	L=A*B/G
	print(int(L))

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


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
def main():
	A,B = map(int, input().split())
	A,B = max(A,B), min(A,B)
	G = gcd(A,B)
	# G:最大公約数, L:最小公倍数
	# AB=GL
	L=A*B/G
	print(int(L))

def gcd(a,b):
#	a,b = max(a,b), min(a,b)
	if a%b == 0:
		return b
	return gcd(a//b, a%b)


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

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

abs = 1
for i in list(range(1,min(A,B)+1))[::-1]:
    if A%i==0 and B%i==0:
        print(i)
        abs = i
        break

print(int(A*B/abs))

Submission status: Wrong Answer

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

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

abs = 1
for i in list(range(1,min(A,B)+1))[::-1]:
    if A%i==0 and B%i==0:
        abs = i

print(int(A*B/abs))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

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

for i in range(1, 100000):
    if i % A == 0 and i % B == 0:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
A,B=list(map(int,input().split()))
if(A>=B):
  num=A
else:
  num=B
i=2
while True:
  ans=num*i
  if(ans%A==0 and ans%B==0):
    print(ans)
    break
  i+=1

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
big = max(a, b)
small = min(a, b)
for i in range(1, 10000):
  if big*i % small == 0:
    print(big*i)
    exit()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ansl = []
if min(a,b) == 1:
  print(max(a,b))
else:
  for i in range(1,min(a,b)//2+1):
    if a%i == 0 and b%i == 0:
      ansl.append(i)
  if not ansl:
    print(a*b)
  else:
    print(int(a*b/max(ansl)))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ansl = []
if min(a,b) == 1:
  print(max(a,b))
else:
  for i in range(1,min(a,b)//2+1):
    if a%i == 0 and b%i == 0:
      ansl.append(i)
  print(int(a*b/max(ansl)))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
commulti = A * B
count = 1
while True:
    if commulti / A / B == 1:
        break

    if count%2 == 0:
        commulti /= A
    else:
        commulti /= B

print(commulti)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
print(6 - (a + b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = [int(s) for s in input().split()]

com = 1
tes = 2
if max(num)%min(num) == 0:
  print(max(num))
else:
  while tes < min(num)/2 +1:
    if min(num)%tes == 0 and max(num)%tes == 0:
      com *= tes
      num = [int(n/tes) for n in num]
    else:
      tes += 1

print(com*min(num)*max(num))

Submission status: Wrong Answer

Solution code:
num = [int(s) for s in input().split()]

com = 1
tes = 2
if max(num)%min(num) == 0:
  print(max(num))
else:
  while tes < min(num)/2:
    if min(num)%tes == 0 and max(num)%tes == 0:
      com *= tes
      num = [int(n/tes) for n in num]
    else:
      tes += 1

print(com*min(num)*max(num))

Submission status: Wrong Answer

Solution code:
num = [int(s) for s in input().split()]

com = 1
tes = 2
if max(num)%min(num) == 0:
  print(max(num))
else:
  while tes < min(num)**0.5:
    if min(num)%tes == 0 and max(num)%tes == 0:
      com *= tes
      num = [int(n/tes) for n in num]
    else:
      tes += 1

print(com*min(num)*max(num))

Submission status: Wrong Answer

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
a, b = i2()
a = min(a,b)
b = max(a,b)
for i in range(1,b+1):
    if a*i%b == 0:
        print(a*i)
        exit()

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
x=min(A,B)
y=max(A,B)
check=1
##x<=y
#####while break##############
if y%x==0:
    print(y)
#print(root)
else:
    root=round((x**(1/2)))
    for i in range(2,root+1):
        if x%i==0 and y%i==0:
            x/=i
            y/=i
            check*=i 
            i=2
            root=round((x**(1/2)))
    print(int(check*x*y))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
x=min(A,B)
y=max(A,B)
check=1
##x<=y
#####while break##############
if y%x==0:
    print(y)
#print(root)
else:
    root=round((x**(1/2)))
    for i in range(2,root):
        if x%i==0 and y%i==0:
            x/=i
            y/=i
            check*=i 
            i=2
            root=round((x**(1/2)))
    print(int(check*x*y))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
x=min(A,B)
y=max(A,B)
check=1
##x<=y
#####while break##############
if y%x==0:
    print(y)
else:
    root=round((x**(1/2)))
    for i in range(2,root):
        if x%i==0 and y%i==0:
            x/=i
            y/=i
            check*=i 
       # print(check)
        i=2
    #print(x,y)
        root=round((x**(1/2)))
    print(int(check*x*y))

Submission status: Wrong Answer

Solution code:
import sys
import math
A,B=map(int,input().split())
if A<B:
  A,B=B,A
if A%B==0:
  print(B)
  sys.exit()
L=[]
for i in range(1,math.ceil(A/2)):
  if A%i==0 and B%i==0:
    L.append(i)
print(int((A*B)/L[-1]))

Submission status: Wrong Answer

Solution code:
import sys
import math
A,B=map(int,input().split())
if A<B:
  A,B=B,A
if B%A==0:
  print(A)
  sys.exit()
L=[]
for i in range(1,math.ceil(A/2)):
  if A%i==0 and B%i==0:
    L.append(i)
print(int((A*B)/L[-1]))

Submission status: Wrong Answer

Solution code:
import sys
import math
A,B=map(int,input().split())
if A<B:
  A,B=B,A
if B%A==0:
  print(A)
  sys.exit()
L=[]
for i in range(1,math.ceil(A/2)):
  if A%i==0 and B%i==0:
    L.append(i)
print((A*B)/L[-1])

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
def gcd(x,y):
    if x % y == 0:
        return y
    elif y % x == 0:
        return x
    else:
        return gcd(y,abs(y-x))
print(a*b/(gcd(a,b)))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
def gcd(x,y):
    if x % y == 0:
        return y
    elif y % x == 0:
        return x
    else:
        return gcd(y,abs(y-x))
print(gcd(a,b))

Submission status: Wrong Answer

Solution code:
import fractions

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

result=float(a*b//fractions.gcd(a,b))
print(result)

Submission status: Wrong Answer

Solution code:

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

if A<B:
    A=B
    B=swapA

Anext=A
Bnext=B
amari=1

while amari!=0:
    amari=Anext%Bnext
    if amari==0:
        Bnext=Bnext
    else:
        Anext=Bnext
        Bnext=amari

A=A/Bnext
B=B/Bnext

print(int(A*B))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import fractions

gcd = fractions.gcd(a,b)

print(a*b*gcd)

Submission status: Wrong Answer

Solution code:
# import math これだとエラーになる 3.4なので
from fractions import gcd
a, b = map(int, input().split())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=sorted(map(int,input().split()))
#ユークリッドの互除法
def gcd(a,b):
    if b==0:
        return a
    #余りが0になったら最後の割る数を出力=lcm
    else:
        return (gcd(b,a%b))
print(a*b/gcd(a,b))
#ユークリッドの互除法)

Submission status: Wrong Answer

Solution code:
a,b=sorted(map(int,input().split()))
#ユークリッドの互除法
def gcd(a,b):
    if b==0:
        return a
    else:
        return (gcd(b,a%b))
        #recursive function
p=gcd(a,b)

if b%p==0:
    print(b)
elif a%p==0:
    print(a)
elif p!=a and p!=b:
    print(p*a*b)
else:
    print(b)
#ユークリッドの互除法)

Submission status: Wrong Answer

Solution code:
a,b=sorted(map(int,input().split()))
#ユークリッドの互除法
def gcd(a,b):
    if b==0:
        return a
    else:
        return (gcd(b,a%b))
        #recursive function

print(gcd(a,b)*a*b)
#ユークリッドの互除法)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from fractions import gcd

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = [int(i) for i in input().split()]
kou = [min(num)]
for i in range(2,min(num)):
    if min(num)%i==0:
        kou.append(i)
a = 1        
for j in kou:
    if max(num)%j==0:
        a = a * j       
print(int(num[0]*num[1]/a))

Submission status: Wrong Answer

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

if gcd !=1:
    left = 0
    right = 10**5
    while right -left > 1:
        m = (right+left) // 2 
        if  gcd * m < a * b:
            left = m
        else:
            right = m

    print(right)

else:
    print(a*b)

Submission status: Wrong Answer

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

if gcd !=1:
    left = 1
    right = 10**5
    while right -left > 1:
        m = (right+left) // 2 
        if  gcd * m < a * b:
            left = m
        else:
            right = m

    print(right)

else:
    print(a*b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
if A > B:
  print(A)
elif A < B:
  print(B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if ((a*b)/2)%2==0:
  print(a*b/2)
else:
  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 = map(int, input().split())
AA = A
BB = B
lcm = 1
cont = 1

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

ans = AA * BB / lcm
print(ans)

Submission status: Wrong Answer

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

lcm = 1
cont = 1

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

print(A * B / lcm)

Submission status: Wrong Answer

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


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

    else:
        return a*b/y


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

C = 0

while C == 0:
  if A % B == 0:
    C = 1
  else:
    A += 1

print(A)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
h = input()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(lcm(a,b))

Submission status: Wrong Answer

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

print(lcm(a,b))

Submission status: Wrong Answer

Solution code:
import math

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

    answer = least_common_multiple(A, B)

    print(answer)
    

def trial_division(n):
    prime_factors = []
    if n <= 2:
        prime_factors.append(1)
        if n != 1:
            prime_factors.append(n)
        return prime_factors
    for i in range(1, math.ceil(int(n/2))):
        if (n%i) == 0:
            prime_factors.append(i)
    prime_factors.append(n)
    return prime_factors

def greatest_common_divisor(a, b):
    a_list = trial_division(a)
    b_list = trial_division(b)
    a_b_and_list = set(a_list) & set(b_list)
    gcd = 1
    if a_b_and_list:
        for i in a_b_and_list:
            gcd = gcd * i
    return gcd

# using Euclidean algorithm
def least_common_multiple(a, b):
    gcd = greatest_common_divisor(a, b)
    lcm = int((a*b) / gcd)
    return lcm

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math

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

    answer = least_common_multiple(A, B)

    print(answer)
    

def trial_division(n):
    prime_factors = []
    if n < 2:
        prime_factors.append(n)
        return prime_factors
    for i in (1, math.ceil(int(n/2)), 1):
        if (n%i) == 0:
            prime_factors.append(i)
    prime_factors.append(n)
    return prime_factors

def greatest_common_divisor(a, b):
    a_list = trial_division(a)
    b_list = trial_division(b)
    a_b_and_list = set(a_list) & set(b_list)
    gcd = 1
    if a_b_and_list:
        for i in a_b_and_list:
            gcd = gcd * i
    return gcd

# using Euclidean algorithm
def least_common_multiple(a, b):
    gcd = greatest_common_divisor(a, b)
    lcm = int((a*b) / gcd)
    return lcm

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math

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

    answer = greatest_common_divisor(A, B)

    print(answer)
    

def trial_division(n):
    prime_factors = []
    if n < 2:
        prime_factors.append(n)
        return prime_factors
    for i in (1, math.ceil(int(n/2)), 1):
        if (n%i) == 0:
            prime_factors.append(i)
    prime_factors.append(n)
    return prime_factors

def least_common_multiple(a, b):
    a_list = trial_division(a)
    b_list = trial_division(b)
    a_b_and_list = set(a_list) & set(b_list)
    lcm = 1
    if a_b_and_list:
        for i in a_b_and_list:
            lcm = lcm * i
    return lcm

def greatest_common_divisor(a, b):
    a_list = trial_division(a)
    b_list = trial_division(b)
    a_b_and_list = set(a_list) ^ set(b_list)
    gcd = 1
    if a_b_and_list:
        for i in a_b_and_list:
            gcd = gcd * i
    return gcd

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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):
  a = A * i
  if ans != 0:
    break
  if a % B == 0:
    ans = a
    break
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

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

print(lcm(A,B))

Submission status: Wrong Answer

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

A, B = map(int, input().split())
if A > B:
  a = A
  b = B
else:
  a = B
  b = A
for i in range(1,b):
  if float(a * i) % float(b) == 0:
    print(a * i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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
    print(aaa)
    if aaa in bn:
        print(aaa)
        break
    count += 1

Submission status: Wrong Answer

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

if Ar[0]>=Ar[1]:
  A=Ar[0]
  B=Ar[1]
else:
  A=Ar[1]
  B=Ar[0]
print(A,B)

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

Ans=int(Ar[0]*Ar[1]/A)
print(Ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

while A==B:
  if A < B:
    A += A
  else:
    B += B

print(A)

Submission status: Wrong Answer

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

if A>B:
	A, B = B, A

# compute lcd
def eculidian_algo(A,B):
	while True:
		q = A//B
		r = A%B
		if r==0:
  			break
		else:
			A,B=B,r
	return B
  
lcd = eculidian_algo(A,B)
gcm = A*B / lcd
print(gcm)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def lcm(n, m):
  bigger = n if n > m else m
  while bigger % n != 0 and bigger % m != 0:
    bigger += 1

print(lcm(a,b))

Submission status: Wrong Answer

Solution code:
import sys
a, b = input().split()

A = int(a)
B = int(b)

Adiv = A
Bdiv = B
k = 0




for i in reversed(range(min([A, B]))):
    j = i+1
    if Adiv % j == 0 and Bdiv % j == 0:
        k = j


if k == 0:
    k = 1


res = A * B / k
if k == min([A, B]):
    res = max([A, B])
print(int(res))

Submission status: Wrong Answer

Solution code:
import sys
a, b = input().split()

A = int(a)
B = int(b)

Adiv = A
Bdiv = B
k = 0




for i in reversed(range(min([A, B]))):
    j = i+1
    if Adiv % j == 0 and Bdiv % j == 0:
        k = j


if k == 0:
    k = 1
    
res = A * B / k
print(int(res))

Submission status: Wrong Answer

Solution code:
import sys
a, b = input().split()

A = int(a)
B = int(b)

Adiv = A
Bdiv = B
k = 0




for i in reversed(range(min([A, B]))):
    j = i+1
    if Adiv % j == 0 and Bdiv % j == 0:
        k = j


res = A * B / k
print(int(res))

Submission status: Wrong Answer

Solution code:
import sys
a, b = input().split()

A = int(a)
B = int(b)

Adiv = A
Bdiv = B
k = 0

for i in range(min([A, B])):
    j = i + 1
    if Adiv % j == 0 and Bdiv % j == 0:
        k = j
    else:
        break

res = A * B / k
print(int(res))

Submission status: Wrong Answer

Solution code:
import operator
import functools

A, B = input().split()

A = int(A)
B = int(B)

value = []

count = 0

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

primeA = prime_factorize(A)

primeB = prime_factorize(B)

if len(primeA) < len(primeB):
    for i in range(len(primeA)):
        for j in range(len(primeB)):
            if primeA[i] == primeB[j]:
                value.append(primeA[i])
                primeA[i] = 1
                primeB[j] = 1
                print(primeA)
                print(primeB)
                break
            else:
                continue

else:
    for i in range(len(primeB)):
        for j in range(len(primeA)):
            if primeB[i] == primeA[j]:
                value.append(primeB[i])
                primeA[j] = 1
                primeB[i] = 1
                print(primeA)
                print(primeB)
                break
            else:
                continue

value = value + primeA + primeB

result = functools.reduce(operator.mul, value)

print(result)

Submission status: Wrong Answer

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

import math

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

print(lcm(A,B))
#print(lcm(A,B))

Submission status: Wrong Answer

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

import math

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

print(A*B)

Submission status: Wrong Answer

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

N = A*B
#print(N)

if A >= B:
    a = int(N/A)
    for i in range(a):
        if A*(a-i) % B == 0:
            N = A*(a-i)

else:
    b = int(N/B)
    for i in range(b):
        print(b-i)
        if B*(b-i) % A == 0:
            N = B*(b-i)

print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ab = list(map(int, input().split()))
a = max(ab)
b = min(ab)
r = a%b
while r!=0:
    a = r
    b = a
    r = a%b
print(int(max(ab) * min(ab)/a))

Submission status: Wrong Answer

Solution code:
#a, b = "100000 99999".split(" ")
a, b = input().split(" ")
a, b = [int(i) for i in [a, b]]
# must be a > b
if b > a:
    c = a
    a = b
    b = c
r = a * b
print(r)

Submission status: Wrong Answer

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

maxInt = max(ints)
minInt = min(ints)

count = 1
while True:
  count += 1

  if maxInt * count % minInt == 0:
    print(maxInt * count)
    break

Submission status: Wrong Answer

Solution code:
p=input().split()
a=int(p[1])
b=int(p[0])
k=a*b
if(a==0 or b==0):
    print(max(a,b))
else:   
 i=1
 if(max(a,b)%min(a,b)==0):
        print(max(a,b))
 else:
  while i<=min(a,b):
   
    if(a%i==0 and b%i==0):
        k=k/i
    i+=1
  print(int(k))

Submission status: Wrong Answer

Solution code:
p=input().split()
a=int(p[1])
b=int(p[0])
k=a*b
if(a==0 or b==0):
    print(max(a,b))
else:
 i=1
 while i<=min(a,b):
    if(a%i==0 and b%i==0):
        k=k/i
    i+=1
 print(int(k))

Submission status: Wrong Answer

Solution code:
p=input().split()
a=int(p[1])
b=int(p[0])
k=a*b
i=1
while i<min(a,b):
    if(a%i==0 and b%i==0):
        k=k/i
    i+=1
print(int(k))

Submission status: Wrong Answer

Solution code:
import math

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

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

print(6)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input().split()
ans=int(a[0])*int(a[1])
while(0==0):
    if ans == int(a[0]) or ans == int(a[1]):
        print(int(ans))
        break
    elif ans%int(a[0])==0:
        ans /= int(a[0])
    elif ans%int(a[1])==0:
        ans /= int(a[1])
    else:
        print(ans)
        break

Submission status: Wrong Answer

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

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

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

print(lcm(a,b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A , B = input().split(" ")
a = int(A)
b = int(B)
n = int(max(a,b)/2)
for x in range (1,n):
  if a%x == 0 and b%x == 0 : a = a/x
print(int(a*b))

Submission status: Wrong Answer

Solution code:
A, B= input().split(" ")
a = int(A)
b = int(B)
for x in range (1,max(a,b)):
  if a%x == 0 and b%x == 0 : a = a/x
print(int(a*b))

Submission status: Wrong Answer

Solution code:
A, B= input().split(" ")
a = int(A)
b = int(B)
list = []
for x in range (1,a):
  if a%x == 0 and b%x == 0 : a = a/x
print(int(a*b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def get_gcd(a, b):
    if a > b:
        r = a % b
    else:
        r = b % a
    if r == 0:
        return b
    else:
        return get_gcd(b, r)
    
    
a, b = map(int, input().split(' '))
g = get_gcd(a, b)
print(int(a * b / g))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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