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:
a,b = map(int,input().split())
if a%b==0 or b%a==0:
    print(max(a,b))
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:
import math 

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

x = math.gcd(a,b)
y = a * b
ans = y / x
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
e=a
d=b
c=1
d=0
if a>b:
  for i in range(1,e):
    if a%(e-i)==0 and b%(e-i)==0:
      a=a/(e-i)
      b=b/(e-i)
      c=c*(e-i)
  print(int(a*b*c))
if a<b:
  for i in range(1,d):
    if a%(d-i)==0 and b%(d-i)==0:
      a=a/(d-i)
      b=b/(d-i)
      c=c*(d-i)
  print(int(a*b*c))

Submission status: Wrong Answer

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=1
d=0
if a>b:
  for i in range(1,a):
    if a%(a-i)==0 and b%(b-i)==0:
      a=a/(a-i)
      b=b/(a-i)
      c=c*(a-i)
  print(int(a*b*c))
if a<b:
  for i in range(1,b):
    if a%(b-i)==0 and b%(b-i)==0:
      a=a/(b-i)
      b=b/(b-i)
      c=c*(b-i)
  print(int(a*b*c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def gcd(a, b):
    if a < b:
        return gcd(b, a)
    while b > 0:
        a, b = b, a % b
    return a
a, b = map(int, input().split())
print(gcd(a, b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
flag = True
res = 0
if a % b == 0 or b % a ==0:
  flag = False
if flag:
  res = a*b
else:
  res = max(a,b)
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

def larger(x,y):
  if x>y:
    return x
  else:
    return y

L=larger(A,B)
S=A+B-L

#rが最大公約数
r=100000
n=100000
if L%S==0:
  r=S
else:
  for i in range(0,L):
    if n!=0:
      r=L%S
      n=S%r
    elif n==0:
      break
      
#最小公倍数求める
p=(L*S)//r
print(p)

Submission status: Wrong Answer

Solution code:
# abc148_c.py
# https://atcoder.jp/contests/abc148/tasks/abc148_c

# C - Snack /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 300点

# 問題文
# 高橋君はパーティを企画しています。
# パーティーでは参加者に 1人 1個以上のお菓子を配る予定です。
# 高橋君は参加者の人数が A人か B人のどちらかになるだろうという予想を立てました。
# どちらの場合でも均等に配りきることができるようなお菓子の個数の最小値を求めてください。
# ただし、 1個のお菓子を分割して複数人で分けることはできないものとします。

# 制約
#     1≤A,B≤105
#     A≠B入力はすべて整数

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A B

# 出力
# 参加者の人数が A人の場合でも B人の場合でも均等に配りきることができるようなお菓子の個数の最小値を出力せよ。

# 入力例 1
# 2 3

# 出力例 1
# 6

# 6個のお菓子があるとき、参加者が 2 人の場合は 3 個ずつ、 3 人の場合は 2個ずつ配ることができます。

# 入力例 2
# 123 456

# 出力例 2
# 18696

# 入力例 3
# 100000 99999

# 出力例 3
# 9999900000


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    A, B = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    import math
    result = (A*B) / math.gcd(A, B)

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2 3']
        lines_export = [6]
    if pattern == 2:
        lines_input = ['123 456']
        lines_export = [18696]
    if pattern == 3:
        lines_input = ['100000 99999']
        lines_export = [9999900000]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
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())
x=a*b
for i in range(2,max(a,b)//2+1):
  if a%i==0 and b%i==0:
    a//=i
    b//=i
    x//=i
print(x)

Submission status: Wrong Answer

Solution code:
def gcd(a, b):
  if a == 0: return b
  if b == 0: return a
  if a == b: return a
  if a > b: return gcd(b, a%b)
  return gcd(a, b%a)
def lcm(a, b):
  if a == b == 0:
  	return abs(a*b)/gcd(a, b)
  return 0
a, b = map(int, input().split())
print(lcm(a, b))

Submission status: Wrong Answer

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

print(A*B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

A_, B_ = A, B
common = 1
n_max = int(min(A,B)**0.5+1)

if A % B == 0:
    print(B)
elif B % A == 0:
    print(A)
else:
    for n in range(2, n_max+1):
        while True:
            if (A_ % n == 0) and (B_ % n == 0):
                common *= n
                A_ = A_ // n
                B_ = B_ // n
            else:
                break

    print(common * A_ * B_)

Submission status: Wrong Answer

Solution code:

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

A_, B_ = A, B
common = 1
n_max = int(min(A,B)**0.5+1)

for n in range(2, n_max+1):
    while True:
        if (A_ % n == 0) and (B_ % n == 0):
            common *= n
            A_ = A_ // n
            B_ = B_ // n
        else:
            break

print(A*B//common)

Submission status: Wrong Answer

Solution code:

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

A_, B_ = A, B
common = 1
n_max = int(min(A,B)**0.5+1)

for n in range(2, n_max+1):
    while True:
        if (A_ % n == 0) and (B_ % n == 0):
            common *= n
            A_ = A_ // n
            B_ = B_ // n
        else:
            break

print(common * A_ * B_)

Submission status: Wrong Answer

Solution code:

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

A_, B_ = A, B
common = 1
n_max = int(min(A,B)**0.5+1)

for n in range(2, n_max):
    while True:
        if (A_ % n == 0) and (B_ % n == 0):
            common *= n
            A_ = A_ // n
            B_ = B_ // n
        else:
            break

print(common * A_ * B_)

Submission status: Wrong Answer

Solution code:

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

A_, B_ = A, B
common = 1
n_max = int(min(A,B)**0.5) + 1
for n in range(2, n_max):
    while True:
        if (A_ % n == 0) and (B_ % n == 0):
            common *= n
            A_ = A_ // n
            B_ = B_ // n
        else:
            break
print(common* A_ * B_)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    print(math.gcd(a,b))
    


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from math 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())
if B > A:
    A,B = B,A

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

Submission status: Wrong Answer

Solution code:
############################################################
print('testing')

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
a_in = []
b_in = []


def findnumeric(x, array):
    for j in range(2, x+1):
        if x % j == 0:
            count = 0
            tmp = x
            while tmp % j == 0:
                tmp //= j
                count += 1
            array.append((j, count))
            x = tmp


findnumeric(A, a_in)
findnumeric(B, b_in)
bag = set(b_in)
for ele in a_in:
    if not ele[0] in bag:
        bag.add(ele)
    else:
        ori_ele = bag.pop()
        if ori_ele[1] < ele[1]:
            bag.add(ele)
        else:
            bag.add(ori_ele)
ans = 1
while bag:
    ele = bag.pop()
    ans = ans * (ele[0]**ele[1])
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def actual(a, b):
    for i in range(1, 10 ** 5 + 1):
        if i % a == 0 and i % b == 0:
            return i

    return a * b


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

Submission status: Wrong Answer

Solution code:
def actual(a, b):
    multiple_a_set = set()
    multiple_b_set = set()

    for i in range(2, 10 ** 5 + 1):
        if i % a == 0:
            multiple_a_set.add(i)
        if i % b == 0:
            multiple_b_set.add(i)

    if multiple_a_set & multiple_b_set:
        return min(multiple_a_set & multiple_b_set)

    # 共通の倍数を持たない場合は、積が最小公倍数
    return a * b


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

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 = map(int, input().split())
large = a if a > b else b
small = b if b < b else b


def gcd(l, s):
    r = l % s
    while r != 0:
        l = s
        s = r
        r = l % s
    return s


print(large*small//gcd(large, small))

Submission status: Wrong Answer

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

large = A if A > B else B
small = A if A < B else B

multi = small

r = large % small
while r != 0:
    multi = r
    r = small % r

print(large*small//multi)

Submission status: Wrong Answer

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

large = A if A > B else B
small = A if A < B else B

multi = small

r = large % small
while r != 0:
    multi = r
    r = small % r

print(int(large/multi*small))

Submission status: Wrong Answer

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

large = A if A > B else B
small = A if A < B else B

multi = small

reminder = large % small
while reminder != 0:
    multi = reminder
    reminder = small % reminder

cross = large/multi

print(int(cross*small))

Submission status: Wrong Answer

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

large = A if A > B else B
small = A if A < B else B

multi = small

reminder = large % small
while reminder != 0:
    multi = reminder
    reminder = small % reminder

cross = large/multi

print(cross*small)

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:
import fractions
a,b=2,3
c=fractions.gcd(a,b)
ans=a*b/c
print(int(ans))

Submission status: Wrong Answer

Solution code:
import fractions

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

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:
# C - Snack
# https://atcoder.jp/contests/abc148/tasks/abc148_c

import fractions

# 最小公倍数を求める問題
A,B = map(int,input().split())

print((A * B) / fractions.gcd(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:
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())
ans=a*b
for i in range(1,min(a,b)):
    if a%i==0 and b%i==0:
        ans/=i
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a%b==0:
    gcd=a
elif b%a==0:
    gcd=b
elif a>b:
    p=a
    q=b
    r=p%q
    while r!=0:
        p=q
        q=r
        r=p%q
        if r==0:
            gcd=q
            break
elif a<b:
    p=b
    q=a
    r=p%q
    while r!=0:
        p=q
        q=r
        r=p%q
        if r==0:
            gcd=q
            break
A=a//gcd
B=b//gcd
print(A*B*gcd)

Submission status: Wrong Answer

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

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

print(snack)

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:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect
import itertools
import heapq


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(input):
    [A, B] = string_to_int(input)
    return A*B


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(input())
    print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
a, b = map(int, input().split())
gcd = 1
for i in range(1, int(sqrt(min(a, b))+1)):
    if a % i == b % i == 0:
        gcd *= i
print(int(a * b / gcd))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
import numpy as np
ls = []
def factorization(n): #素因数分解のプログラム([素因数,指数]のリストのリストで出力→24→[[2, 3], [3, 1]])
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr 
for j in range(len(factorization(a))):
    x = factorization(a)[j][0]
    ls.append(x)
for l in range(len(factorization(b))):
    y = factorization(b)[l][0]
    ls.append(y)
d = list(set(ls))
e = np.prod(d)
print(e)

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())
i = 0
while True:
    if i % A == 0 and i % B == 0:
        print(i)
        break
    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import fractions

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

A_lis = prime_factorize(A)
A_lis.append(1)
B_lis = prime_factorize(B)
B_lis_new = [i for i in B_lis if i not in A_lis]

ans = 1

for i in A_lis:
    ans *= i
for j in B_lis_new:
    ans *= j

print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

A_lis = prime_factorize(A)
B_lis = prime_factorize(B)
AB_lis = A_lis + B_lis

ans = 1

for i in set(AB_lis):
    ans *= i

print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
A, B = map(int, input().split())
for i in range(1, B):
    if A*i % B == 0:
        print(A*i)
        break

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split());
a_y = [];
b_y = [];

for i in range(2,114514):
  if a > 1:
    if a % i == 0:
      a = a // i;
      a_y.append(i);
  else:
    break;
    
for i in range(2,114514):
  if b > 1:
    if b % i == 0:
      b = b // i;
      b_y.append(i);
  else:
    break;

y = a_y + b_y;
y = list(set(y));

ans = 1;

for i in y:
  ans = ans * i;

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    a = max(a, b)
    b = min(a, b)

    d = gcd(a, b)
    d1 = a / d
    d2 = b / d
    print(int(d * d1 * d2))


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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    a, b = map(int, input().split())
    a = min(a, b)
    b = max(a, b)

    d = gcd(a, b)
    d1 = a / d
    d2 = b / d
    print(int(d * d1 * d2))


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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a < b:
  a, b = b, a
while a % b != 0:
  a, b = b, a%b
  
print(int(a*c/b))

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if b%a==0 or a%b==0:
  print(b)
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())
seki = A*B

if B>A:
    C = A
    A = B
    B = C

while A%B != 0:
    a = A
    b = B
    A = a//b
    B = a%b
    
print(int(seki/B))

Submission status: Wrong Answer

Solution code:
import math

Submission status: Wrong Answer

Solution code:
def GCD(x,y):
  if y == 0:
    return 1
  return GCD(y, x%y)

print(GCD(1,5))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
A=a
B=b
while b%a>0:
  e=a
  a=b%a
  b=e

A=A//a
B=B//a
print(str(A),str(B),str(a))
print(str(int(A*B*a)))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def factor(num):
  l = []
  for i in range(2,num+1):
    if num%i==0:
      l.append(i)
  return l

l1 = factor(num1)
l2 = factor(num2)
l1 = l1+l2
l = set(l1)

ans = 1
for _ in l:
  ans = ans * _
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

#c=int((a*b)/math.gcd(a,b))
c=0

print(c)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
if a>b:
  c = a//b
  d = a/c
  e = b/c
  print(int(min(a*e, b*d)))
else:
  f = b//a
  g = a/f
  h = b/f
  print(int(min(a*h, b*g)))

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 = map(int, input().split())
for i in range(min(a,b), max(a,b)+1):
  if not i % a and not i % b:
    print(i)
    quit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
gcd = 1
prime = []
roota = math.floor(a**(1/2))
for i in range(1, roota + 1):
    if a % i == 0 and b % i == 0:
        prime.append(i)
for i in prime:
    gcd *= i
if b % a == 0:
    gcd = a
print(int(a * b / gcd))

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
gcd = 1
prime = []
roota = math.floor(a**(1/2))
for i in range(1, roota + 1):
    if a % i == 0 and b % i == 0:
        prime.append(i)
for i in prime:
    gcd *= i
print(int(a * b / gcd))

Submission status: Wrong Answer

Solution code:
from fractions import gcd

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

print(gcd(a, b))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def main(A, B):
  A, B = list(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(gcd(A,B))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
#互いに素の時は1, そうでない時は最小の公約数を出力
def coprime_checker(x,y):
    if min(x,y) == 1:
        return 1
    else:
        for i in range(2,min(x,y) + 1):
            if x % i == 0 and y % i == 0:
                return i
                break
        return 1
#
gcd = 1
x = a
y = b
while coprime_checker(int(x),int(y)) != 1:
    gcd *= coprime_checker(int(x),int(y))
    x /= coprime_checker(int(x),int(y))
    y /= coprime_checker(int(x),int(y))
least_common_multiple  = (a*b) / gcd
print(int(least_common_multiple))

Submission status: Wrong Answer

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

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):
	print(a,b,divmod(a,b))
	if a%b==0:
		return b
	return gcd(b, a%b)


if __name__ == '__main__':
	main()