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: Accepted

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

def lcm(a,b):
    y = a*b / math.gcd(a,b)
    return int(y)
print(lcm(a,b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
maxi = max(A,B)
mid = maxi
mini = min(A,B)
res = 0
if A % B ==0 or B % A ==0:
  res = maxi
while res ==0:
  if maxi % mini == 0:
    res = maxi
  maxi += mid
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
A,B = map(int,input().split())
print(np.lcm(A,B))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    a,b = map(int, input().split())
    print(int(a*b/gcd(a,b)))

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    a,b = map(int, input().split())
    ans = max(a,b)
    first = ans
    m = min(a,b)
    while True:
        if ans%m == 0:
            print(ans)
            exit()
        ans += first

if __name__=="__main__":
    main()

Submission status: Accepted

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(min(a * b, ans))

Submission status: Accepted

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

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x,y):
 if y==0:return x
 else:return gcd(y, x % y)
def lcm(x,y):
  return x/gcd(x, y)*y;
print(int(lcm(*map(int,input().split()))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    from math import gcd
    n, k = map(int, input().split())
    print(n * k // gcd(n, k))


solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import math

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

print(lcm(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def lcm(a,b):#最小公倍数
    ori_a=a
    ori_b=b
    while b!=0:
        a,b=b,a%b
    return (ori_a*ori_b)//a

ans=lcm(a,b)
print(ans)

Submission status: Accepted

Solution code:
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a,b=inintm()

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
from math import gcd

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

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

Submission status: Accepted

Solution code:
import math

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
import fractions


def lcm(x: int, y: int) -> int:
    return (x * y) // fractions.gcd(x, y)


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

print(lcm(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# least common multiple
def lcms(*numbers):
    from math import gcd
    from functools import reduce
    def lcm_base(x, y):
        return (x * y) // gcd(x, y)
    return reduce(lcm_base, numbers)

def resolve():
    A, B = list(map(int, input().split()))
    print(lcms(A, B))



if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
# 最小公倍数
g = int(A * B / math.gcd(A, B))
print(g)

Submission status: Accepted

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=L%S
while r!=0:
  L=S
  S=r
  r=L%S
  
#最小公倍数求める
p=(A*B)//S
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l = lcm(a, b)
print(min(l,a*b))

Submission status: Accepted

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)
    result = int(result)
    
    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: Accepted

Solution code:
import math

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
import math


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
from math import gcd

def readinput():
    a,b=map(int,input().split())
    return a,b

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

if __name__=='__main__':
    a,b=readinput()
    ans=main(a,b)
    print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

print(np.lcm(A, B))

Submission status: Accepted

Solution code:
import math

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

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

print(lcm(A, B))

Submission status: Accepted

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

print(int(A*B/math.gcd(A,B)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
A, B = [int(i) for i in input().split()]
print((A * B) // math.gcd(A, B))

Submission status: Accepted

Solution code:
a,b=[int(i) for i  in input().split()]
c=max(a,b)
if(a<=b):
    d=a
else:
    d=b
for i in range(1,100001):
    if((d*i)%c==0):
        print(d*i)
        break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import gcd

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

lcm = int(a*b/gcd(a,b))

print(lcm)

Submission status: Accepted

Solution code:
import math

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

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

print(lcm(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
#Author: M@sud_P@rvez

import math

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

Submission status: Accepted

Solution code:
#Author: M@sud_P@rvez

import math

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
from math import gcd
def lcm(a, b):
    return a * b // gcd (a, b)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

def lcm(x,y):
  return x*y//math.gcd(x,y)
A,B=map(int,input().split())
print(lcm(A,B))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

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


if(__name__ == '__main__'):
  main()

Submission status: Accepted

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 0
    return abs(a*b)/gcd(a, b)
a, b = map(int, input().split())
print(int(lcm(a, b)))

Submission status: Accepted

Solution code:
from sys import exit
def main():
  A, B = map(int, input().split())
  
  if A % B == 0:
    print(A)
    exit()
  elif B % A == 0:
    print(B)
    exit()
  elif A == B :
    print(A)
    exit()
    
  large = 0
  small = 0
  if A > B:
    large = A
    small = B
  else:
    large = B
    small = A
    
  i = 2
  while True:
    if (large * i) % small == 0:
      print(large * i)
      exit()
    i += 1
  
  
  
  
  
main()

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

Solution code:
def gcd(A, B)->int:
  A = A % B
  if A == 0:
    return B
  else:
    return gcd(B, A)
    

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

A, B = mapint()
from math import gcd
print(A*B//gcd(A, B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
x = A
y = B
while y>0:
    x,y = y,x%y
print((A//x)*B)

Submission status: Accepted

Solution code:
from math import gcd

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

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

Submission status: Accepted

Solution code:
from math import gcd

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import math



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

Submission status: Accepted

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

Submission status: Accepted

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

def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a % b);

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

Submission status: Accepted

Solution code:
import math
A, B = [int(s) for s in input().split(' ')]
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))

Submission status: Accepted

Solution code:
import math

A, B = [int(s) for s in input().split()]
print(A * B // math.gcd(A, B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math
from functools import reduce

def lcm(vals):
    return reduce((lambda x, y: (x * y) // math.gcd(x, y)), vals, 1)

(A, B) = [int(n) for n in input().split()]
print(lcm([A, B]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 1
while True:
    x = a * i
    if x % b == 0:
        print(x)
        exit()
    i += 1

Submission status: Accepted

Solution code:
import math

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

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

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

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

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Accepted

Solution code:

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


if A % B == 0:
    print(A)
elif B % A == 0:
    print(B)
else:
    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: Accepted

Solution code:
from math import gcd

def snack(a, b):

    icm = (a*b // gcd(a, b))
    return icm

def main():
    a, b = map(int, input().split())
    print(snack(a, b))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b = [int(x) for x in input().split()]
print(a*b//math.gcd(a,b))

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

def solve():
    ans = (A*B) // math.gcd(A,B)
    print(ans)

if __name__ == "__main__":
    A,B = list(map(int, input().split()))
    solve()

Submission status: Accepted

Solution code:
import sys 
from math import gcd
from functools import reduce
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A, B = map(int, readline().split())
AB = []
AB.append(A)
AB.append(B)
lcm = reduce(lambda x,y:x*y//gcd(x,y),AB)
print(lcm)

Submission status: Accepted

Solution code:
from math import gcd

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

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

    def lcd(a, b):
        return int(a / gcd(a, b)) * b
    
    a, b = map(int, input().split())
    ans = lcd(a, b)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

for i in range(b):
    if c % b == 0:
        break
    c += a

print(c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
import math

def main():
    A, B = map(int, input().split())
    print((A * B) // math.gcd(A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


a,b = map(int, input().split())
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
 
def lcm(a, b):
    return a//gcd(a, b)*b
print(lcm(a,b))

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
from math import gcd

A, B = [int(x) for x in input().split()]

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

Submission status: Accepted

Solution code:
import math

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

print(int(A*B / math.gcd(A, B)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

A, B = LI()
print(A * B // math.gcd(A, B))

Submission status: Accepted

Solution code:
import sys
iput = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

def gcd(big, small):
    if small == 0:
        return big
    else:
        return gcd(small, big % small)

# gcd(a, b) * lcm(a, b) == a * b
def lcm(a, b):
    # 除算を先にしてオーバーフローのリスクを軽減する
    # FYI: https://qiita.com/drken/items/0c88a37eec520f82b788#2-2-%E5%8D%98%E7%B4%94%E3%81%AA%E6%9C%80%E5%B0%8F%E5%85%AC%E5%80%8D%E6%95%B0%E3%82%B2%E3%83%BC
    return (a // gcd(a, b)) * b

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math
a,b=map(int, input().split())
print(a*b//math.gcd(a,b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(a,b):
  if b ==0:
    return a
  else:
    return gcd(b, a%b)
  
  
A,B = map(int, input().split())
A,B = (A,B) if A>B else (B,A)

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

print(int(A * B / math.gcd(A, B)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

gcd = math.gcd(a, b)

ans = a*b//gcd

print(ans)

Submission status: Accepted

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

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

for j in lst:
  if j%b == 0:
    print(j)
    break

Submission status: Accepted

Solution code:
import sys
from math import gcd

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
from functools import reduce


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


# 最小公倍数
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

# AでもBでも割り切れる数の最小値、それが最小公倍数だ
A, B = [int(x) for x in input().split()]

ans = lcm(A, B)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def calculate_gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def calculate_lcm(x, y):
    lcm = (x*y)//calculate_gcd(x,y)
    return lcm


str = input()
list1=str.split(' ')
a=int(list1[0])
b=int(list1[1])

lcm= calculate_lcm(a,b)

print(lcm)