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 decomposition(x, prime):
    ret_dec = []
    for i in range(x+1):
        if i in prime:
            q = 0
            while(x % i == 0):
                x /= i
                q += 1
            ret_dec.append(q)
    return ret_dec

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

prime = []

decA = []
decB = []

i=2
N = max(A, B)
for p in range(2, N):
    tf = True
    i = 2
    while(i*i <= p):
        if p % i == 0:
            tf = False
            break
        i += 1
    if tf:
        prime.append(p)

decA = decomposition(A, prime)
decB = decomposition(B, prime)

com_len = min(len(decA), len(decB))
ans = 1
for i in range(com_len):
    ans *= prime[i] ** max(decA[i], decB[i])
if len(decA) >= len(decB):
    for i in range(com_len, len(decA)):
        ans *= prime[i] ** decA[i]
else: 
    for i in range(com_len, len(decB)):
        ans *= prime[i] ** decB[i]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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]) + 1) // 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()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
number_of_guests = input().split()

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


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

    if (A <= 1):
        break

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

    if (B <= 1):
        break

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

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

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


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

print(x)

Submission status: Wrong Answer

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

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

div_result = 0

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

print(large_num/div_result*small_num)

Submission status: Wrong Answer

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

p = 2


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

Submission status: Wrong Answer

Solution code:

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

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

div_result = 0

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

print(large_num/div_result*small_num)

Submission status: Wrong Answer

Solution code:
s=input().split()
i=int(s[0])
j=int(s[1])
amari=[]
a=""
if i<j:
  p_1=j
  p_2=i
else:
  p_1=i
  p_2=j

while a=="":
  am=p_1%p_2
  if am==0:
    break
  amari.append(am)
  p_1=p_2
  p_2=am
if len(amari)==0:
  a=str(p_1)
else:
  m=amari[-1]
  k=i*j/m
  a=str(k)
print(a)

Submission status: Wrong Answer

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

print(int(complete))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(int(complete))

Submission status: Wrong Answer

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

print(int(complete))

Submission status: Wrong Answer

Solution code:
from collections import Counter

def factor(n):
    # netで探した実装
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > i:
       table.append(n)
    return table

a, b = map(int, input().split())
fa = factor(a)
fb = factor(b)
ca = Counter(fa)
cb = Counter(fb)

for k in ca.keys():
    while ca.get(k, 0) and cb.get(k, 0):
        ca[k] -= 1 #; cb[k] -= 1

ans = 1
for k, v in ca.items():
    ans *= k ** v
for k, v in cb.items():
    ans *= k ** v
print(ans)

Submission status: Wrong Answer

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

print(complete)

Submission status: Wrong Answer

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

num = [1]
for i in range(2, min(A, B) + 1):
    if A % i == 0 and B % i == 0:
        num.append(i)
        A = A // i
        B = B // i

ans = A * B
for i in range(len(num)):
    ans *= num[i]

print(ans)

Submission status: Wrong Answer

Solution code:
def factor(n):
    # netで探した実装
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > i:
       table.append(n)
    return table
from collections import Counter

a, b = map(int, input().split())
fa = factor(a)
fb = factor(b)
ca = Counter(fa)
cb = Counter(fb)
print(fa,fb)
print(ca,cb)
for k in ca.keys():
    while ca.get(k, 0) and cb.get(k, 0):
        ca[k] -= 1 #; cb[k] -= 1
print(ca,cb)
ans = 1
for k, v in ca.items():
    ans *= k ** v
print(ans)
for k, v in cb.items():
    ans *= k ** v
    print(ans)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
import math
A, B = map(int, input().split())
max_num = max(A, B)
sqrt_max_num = int(math.sqrt(max_num))
prime_list = [2, 3]
for num in range(4, sqrt_max_num+1):
    for prime_num in prime_list:
        if num % prime_num == 0:
            break
    else:
        prime_list.append(num)
same_div_list = []
a = A
b = B
while True:
    for prime_num in prime_list:
        if a % prime_num == 0 and b % prime_num == 0:
            same_div_list.append(prime_num)
            a = a / prime_num
            b = b / prime_num
            break
    else:
        same_div_list.append(a)
        same_div_list.append(b)
        break
total_div = 1
for same_div in same_div_list:
    total_div = total_div * same_div
print(int(total_div))

Submission status: Wrong Answer

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

x = a*b
l = a if a<b else b

for i in range(l, 1, -1):
    if a%i == 0 and b%i == 0:
        x /= i

print(int(x))

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)
        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)
        if C==1:
            C=int(A*B)
        print(C)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

a = sorted(prime(a))
b = sorted(prime(b))

print(a, b)
c = set()


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

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

    return e

print(cal(a, b))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import math
if __name__ == '__main__':
    A, B = map(int, input().rstrip().split())
    print(A, B)

Submission status: Wrong Answer

Solution code:
import math
a,b=[int(i) for i in input().split()]
def lcm(x,y):
    return int((x*y) / math.gcd(x,y))

  
  
#m=lcm(a,b) 
m=0
print(m)

Submission status: Wrong Answer

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

x = a*b
l = a if a<b else b

for i in range(2, l+1):
    if a%i == 0 and b%i == 0:
        x /= i

print(int(x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

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

n = np.array(primes(min(A*B,100000)))

i = 1
while i == 1:
  i = 0
  for j in range(len(n)):
    if A % n[j] == 0 and B % n[j] == 0:
      A = A / n[j]
      i = 1

S = int(A * B)
print(S)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections

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


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

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

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

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

result = 1

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

print(result)

Submission status: Wrong Answer

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

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

dict_a = {}
dict_b = {}

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

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

Submission status: Wrong Answer

Solution code:
import math as m
get = list(map(int, input().split()))
A = get[0]
B = get[1]
end = max(A, B)
for i in range(2, end):
  while(A % i == 0 and B % i == 0):
    A = A / i
ans = A * B
print(int(ans))

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

for i in range(int(B ** 0.5) + 1)[::-1]:
    if A % i == 0 and B % i == 0:
        a = i
        break

if B % A == 0:
    print(B)
    exit()

print(int(A * B / a))

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
anser = 0
for i in range(0,10**5 + 1):
    if i < a or i < b:
        continue
    if i % a == 0 and i % b == 0:
        anser = i
        break

if anser == 0:
    print(a * b)
else:
    print(anser)

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
#problemC: Snack
a,b = list(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)

lcm(a,b)

Submission status: Wrong Answer

Solution code:
import math
a, b=[int(i) for i in input().split()]
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

#m=lcm(a, b)  
#print(m)

Submission status: Wrong Answer

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

for i in range(int(A ** 0.5) + 1)[::-1]:
    if A % i == 0 and B % i == 0:
        a = i
        break

if A < B:
    if B % A == 0:
        print(B)
        exit()
else:
    if A % B == 0:
        print(A)
        exit()

print(int(A * B / a))

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(2, (min([A, B]) + 1) // 2):
        if A % divisor == 0 and B % divisor == 0:
            A = A // divisor
            B = B // divisor
            product = product // divisor

    print(product)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
anser = 0
for i in range(1,10**5 + 1):
    if i < a or i < b:
        continue
    if i % a == 0 and i % b == 0:
        anser = i
        break

if anser == 0:
    print(a * b)
else:
    print(anser)

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 (A*B) / gcd(A,B)

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

Submission status: Wrong Answer

Solution code:
#import math

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

print(a*b)

Submission status: Wrong Answer

Solution code:
import math
a, b=[int(i) for i in input().split()]
#def lcm(x, y):
#    return (x * y) // math.gcd(x, y)

#m=lcm(a, b)  
#print(m)

Submission status: Wrong Answer

Solution code:
#import math
a, b=[int(i) for i in input().split()]
#def lcm(x, y):
#    return (x * y) // math.gcd(x, y)

#m=lcm(a, b)  
#print(m)

Submission status: Wrong Answer

Solution code:
A, B = list(map(int, input().split()))
N = 1
i = 1
if A <= B:
  while (N % A) != 0:
    N = B * i
    i += 1
else:
  while (N % B) != 0:
    N = A * i
    i += 1
print(N)

Submission status: Wrong Answer

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

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

dict_a = {}
dict_b = {}

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

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

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
anser = 0
for i in range(1,10**5):
    if i < a or i < b:
        continue
    if i % a == 0 and i % b == 0:
        anser = i
        break

if anser == 0:
    print(a * b)
else:
    print(anser)

Submission status: Wrong Answer

Solution code:
import math as mt
a,b=map(int,input().split())
tem=max(a,b)
c=1
if a==b:
    print(a)
elif min(a,b)==1:
    print(max(a,b))
else:
        
    while 1:
        c+=1
        if (tem*c)%a==0 and (tem*c)%b==0:
            print(tem*c)
            break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math as mt
a,b=map(int,input().split())
tem=max(a,b)
c=1
while 1:
    c+=1
    if (tem*c)%a==0 and (tem*c)%b==0:
        print(tem*c)
        break

Submission status: Wrong Answer

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

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


for i in range(c,1,-1) :

    while (a%i==0 and b%i==0) :
        a = a / i
        b = b / i
        ans = ans / i

print(ans)

Submission status: Wrong Answer

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

minV = min(A, B)
maxV = max(A, B)

if maxV % minV == 0:
  print(maxV)

if maxV == minV + 1:
  print(maxV * minV)

v = maxV * 2

for i in range(2, minV + 1):
  if v % minV != 0:
    v += maxV
    continue
  print(v)
  exit()

Submission status: Wrong Answer

Solution code:
import math

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

for i in range(int(A ** 0.5) + 1)[::-1]:
    if A % i == 0 and B % i == 0:
        a = i
        break

print(int(A * B / a))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
def gcd(a,b):
    if a < b:
        temp = b
        b = a 
        a = temp
    remainder = a % b
    if remainder == 0:
        return b
    else:
        return gcd(remainder,b)
 
def gys(a,b):
    remainder = gcd(a,b)
    print(a*b/remainder)
print(gys(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(2, min([A, B]) + 1):
        if A % divisor == 0 and B % divisor == 0:
            A = A // divisor
            B = B // divisor
            product = product // divisor

    print(product)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
A, B = input().split()
a = int(A)
b = int(B)
while(a % b != 0 and b % a != 0):
  if(a>b):
    tmp = a // b
    a = a % b
  else:
    tmp = b // a
    b = b % a
if(a % b == 0 and b != 1):
  tmp = a // b
elif(b % a == 0 and a != 1):
  tmp = b // a
else:
  tmp = 1
print(int(A) * int(B) // tmp)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
def gcd(a,b):
    if a < b:
        temp = b
        b = a 
        a = temp
    remainder = a % b
    if remainder == 0:
        return b
    else:
        return gcd(remainder,b)

def gys(a,b):
    remainder = gcd(a,b)
    print(a*b/remainder)
gys(a,b)

Submission status: Wrong Answer

Solution code:
A, B = input().split()
a = int(A)
b = int(B)
while(a % b != 0 and b % a != 0):
  if(a>b):
    tmp = a // b
    a = a % b
  else:
    tmp = b // a
    b = b % a
if(a % b == 0):
  tmp = a // b
else:
  tmp = b // a
print(int(A) * int(B) // tmp)

Submission status: Wrong Answer

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

ans = a * b

for i in range(a,1,-1) :

    while (a%i==0 and b%i==0) :
        a = a / i
        b = b / i
        ans = ans / i

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
q=a
w=b
if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b
q=q//b
w=w//b
print(q*w)

Submission status: Wrong Answer

Solution code:
s=input()
s=s.split(' ')
print(str(int(s[0])*int(s[1])))

Submission status: Wrong Answer

Solution code:
A,B= input().split() 
A=int(A)
B=int(B)
seki=A*B
#print(A,B,seki)
for i in range(2,A+1):
  if round(int(A/i)*i,0)==A:
    if round(int(B/i)*i,0)==B:
#      print(i)
      seki/=i
print(round(seki))

Submission status: Wrong Answer

Solution code:
s=input()
s=s.split(' ')
print(int(s[0])*int(s[1]))

Submission status: Wrong Answer

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

memo = 0
i = 1
if A < B:
    A, B = B, A

while memo < 100000:
    memo = A * i
    if memo % B == 0:
        break
    else:
        i += 1
print(memo)

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:
def lcm(a,b):
  m=max(a,b)
  n=min(a,b)
  kk=0
  for j in range(m,a*b,n):
    if j%a==0 and j%b==0:
      kk=j
      break
  return kk
a,b=map(int,input().split())
c=lcm(a,b)
print(c)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
for i in range(100000):
  if (i != 0)&(i%A == 0) & (i%B == 0):
    print(i)
    break

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
def GCD(p,q):
    if p<q:
        p,q = q,p
    p = q
    q = p%q
    if q!=0:
        GCD(p,q)
    else:
        return p
gcd = GCD(A,B)
ans = (A*B)//gcd
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
if A > B:
  num1 = A % B
  if not num1:
    print(A)
  else:
    print(A * B)
else:
  num2 = B % A
  if not num2:
    print(B)
  else:
    print(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:
s=input()
n=[int(e)for e in s.split(' ')]
print(n[0]*n[1])

Submission status: Wrong Answer

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

flg = True

while flg:
  M = min(A,B)
  flg = False
  for m in range(M,1,-1):
    if A%m==0 and B%m==0:
      B=int(B/m)
      flg = True
      break
      
print(A*B)

Submission status: Wrong Answer

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

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 = 2
  a += 1
  if N <= a or S <= a:
    break
print(tmp * S * N)

Submission status: Wrong Answer

Solution code:
a,b = [int(i) for i in input().split()]
i = max(a,b) * 2
while(True):
    if (i%a == 0) and (i%b ==0):
        print(i)
        break
    i +=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l=list(map(int, input().strip().split(' ')))
a=l[0]
b=l[1]
c=a*b
if a>b:
    d=a//b
else:
    d=b//a
print(c//d)

Submission status: Wrong Answer

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

if (a<b):
  tmp = a
  a = b;
  b = tmp

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

print(x/b)

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 <= a or S <= a:
    break
print(tmp * S * N)

Submission status: Wrong Answer

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

M = min(A,B)

flg = True

while flg:
  flg = False
  for m in range(M,1,-1):
    if A%m==0 and B%m==0:
      B=int(B/m)
      flg = True
      break
      
print(A*B)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(a*b//c)

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
gcc=1
i=2
while True:
    if(a<i or b<i):
        break
    elif (a%i==0 and b%i==0):
        print(i)
        gcc*=i
        a/=i
        b/=i
        i=2
    else:
        i+=1

print(int(a*b*gcc))

Submission status: Wrong Answer

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

_A, _B = min(A, B), max(A, B)

pres = 1
while True:
    res = _B % _A
    if res == 0:
        break
    else:
        pres = res
        _B = _A
        _A = res

print(A * B // pres)

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

Submission status: Wrong Answer

Solution code:
"""
Atcoder_Beginner_Contest_148
C

"""
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000)

A, B = map(int, input().split())
tmp_a, tmp_b = A, B
print(tmp_a, tmp_b)
while tmp_a % tmp_b != 0:
    tmp_a, tmp_b = tmp_b, tmp_a % tmp_b
    # temp = B
    # B = A % B
    # A = temp


print(int(A * B / tmp_b))

Submission status: Wrong Answer

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

import fractions

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

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

def devide_ok(x, y):
  if y / x == y // x:
    return True
  else:
    return False
  
for i in range(1, b + 1):
  if a * i > b and devide_ok(b, a * i):
    print(a * i)
    break