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
import fractions
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))




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


a,b=input2()

print(lcm(a,b))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(20000000)
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
C = gcd(A, B)
print(A*B//C)

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

multiply = 1
while True:
    if A * multiply % B  == 0:
        break
    multiply += 1

answer = A * multiply

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

def euclid(num1,num2):
  if num1<num2: num1,num2 = num2,num1
  while num2>0:
    r = num1%num2
    num1 = num2
    num2 = r
  return num1

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

Submission status: Accepted

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

Submission status: Accepted

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(int(A*B*a)))

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# from math import gcd
from fractions import gcd

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np
import fractions

def solve(A: int, B: int):
    print(A*B//fractions.gcd(A,B))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

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

print(lcm(A,B))

Submission status: Accepted

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

def gcd(a,b):
    num=[a,b]
    GCD=0
    for i in range(1,min(num)+1):
        if a%i==0 and b%i==0:
            GCD=i
    return GCD
            
print(int(A*B/gcd(A,B)))

Submission status: Accepted

Solution code:
def gcd(a,b):
    if a==0 or b==0:
        return max([a,b])
    else:
        if a>=b:
            n=int(a/b)
            return gcd(a-n*b,b)
        else:
            n=int(b/a)
            return gcd(a,b-n*a)

def lcm(a,b):
   return int(a*b/gcd(a,b)) 
a=input().split(" ")
print(lcm(int(a[0]),int(a[1])))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
import fractions
def lcm(a,b):
    f=a*b//fractions.gcd(a,b)
    return f
def main():
    a,b=map(int,input().split())
    print(lcm(a,b))

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import fractions
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b=map(int,input().split())
    f=fractions.gcd(a,b)
    f2=a*b//f
    print(f2)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a, b)
a, b = map(int, input().split())
print(lcm(a, b))

Submission status: Accepted

Solution code:
# C - Snack

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(X,Y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

Solution code:
import fractions

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
num = max(A, B)
while True:
  if A % num == 0 and B % num == 0:
    break
  else:
    num = num - 1
  if num == 1:
    break
print(int(min(A, B) * max(A, B)/num))

Submission status: Accepted

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

Submission status: Accepted

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

import math
def gcd(num1, num2):
  for i in range(min(num1, num2),0,-1):
    if num1%i==0 and num2%i==0:
      return i
    
print(int(num1*num2/gcd(num1,num2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

c=0

while(1):
  c+=a
  if c%b==0:
    print(c)
    break

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

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

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

A, B = i_l()

print(lcm(A,B))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
a = A
b = B
while a * b:
    if a > b:
        a = a % b
    else:
        b = b % a
print(A * B // (a + b))

Submission status: Accepted

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

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 sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from fractions import gcd

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

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def No(): print('No')

def sieves_of_e(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 is_prime


def prime_factorize(n):
    res = []
    for i in range(2, int(n**0.5)+1):
        if n % i != 0: continue
        ex = 0

        while (n % i == 0):
            ex += 1
            n //= i
        res.append((i, ex))
    if n != 1: res.append((n, 1))
    return res

A,B = imn()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
A,B = (int(x) for x in input().split(" "))

#最小公倍数を求める
from functools import reduce
import fractions #(2020-0405  fractions→math)
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y) # 「//」はフロートにせずにintにする
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

saisyou_koubaisu = lcm(A,B)

print(saisyou_koubaisu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

def main():
    A, B = map(int, input().split())
    XA = prime_factorize(A)
    XB = prime_factorize(B)
    sum = 1
    for i in XA:
        if i in XB:
            XB.remove(i)
        sum *= i

    for j in XB:
        sum *= j

    print(sum)

main()

Submission status: Accepted

Solution code:
import fractions

# 入力
A,B = map(int,input().split())

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

Submission status: Accepted

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

if a < b:
  a, b = b, a

p = a
q = b

while True:
  r = a % b
  a, b = b, r
  if r == 0:
    break
    
print(p*q//a)

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
a, b=map(int, input().split())
#最大公約数を求める
c=fractions.gcd(a, b) 
print(a*b//c)

Submission status: Accepted

Solution code:
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 * b) // gcd(a, b)

print(lcm(a, b))

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):
  while b!=0:
    a,b=b,a%b
  return a

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from fractions import gcd


def solve(A: int, B: int):
    print(A*B//gcd(A, B))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import fractions

a,b=map(int,input().split())
c=fractions.gcd(a,b)

print(a*b//c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import Counter, deque

INF = float('inf')


def gcd(a, b):
    """
    Greatest Common Divisor
    Euclidean Algortihm
    """
    if a < b:
        gcd(b, a)
    while b != 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    """
    Least Common Multiple
    """
    return a * b // gcd(a, b)


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from fractions import gcd
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:
A,B = map(int,input().split())
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
print(A*B // euclid(A, B))

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
import sys
sys.setrecursionlimit(10**8)


def lcm2(x, y):
    return (x * y) // fractions.gcd(x, y)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
a,b=map(int, input().split())
f=fractions.gcd(a,b)
f2=a*b//f # 最小公倍数はf2
print(f2)

Submission status: Accepted

Solution code:
from fractions 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 fcd(a , b):
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return a*b//fcd(a , b)


print(lcm(a,b))

Submission status: Accepted

Solution code:
from fractions import gcd

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

if __name__ == '__main__': main()

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
i=1
C=max(A,B)
while C*i%min(A,B) != 0:
    i+=1
print(C*i)

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/C-Snack.py
#
from fractions import gcd

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a, b):
    return (a * b)//gcd(a,b)

print(lcm(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
ab=input().rstrip().split(" ")
a=int(ab[0])
b=int(ab[1])
if a>=b:
    l=a
    s=b
elif a<b:
    l=b
    s=a
for i in range(1,s+1):
    u=i*l
    if u%s==0:
        ans=u
        print(ans)
        sys.exit()

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    mod = 10**9 + 7

    a,b = map(int, input().split())
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    def gcd_group(arr):
        g = gcd(arr[0], arr[1])
        for i in range(2, len(arr)):
            g = gcd(g, arr[i])
        return g
    
    def lcm(a, b):
        g = gcd(a, b)
        return (a*b)//g
    
    def lcm_group(arr):
        l = lcm(arr[0], arr[1])
        for i in range(2, len(arr)):
            l = lcm(l, arr[i])
        return l
    
    print(lcm(a,b))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import fractions

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import fractions
A, B = (int(x) for x in input().split(' '))
func = lambda a, b: a * b // fractions.gcd(a,b)
print(func(A,B))

Submission status: Accepted

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

n=max(a,b)
m=min(a,b)
ans=0
for i in range(1,m+1):
    ans=n*i
    if ans%m==0:
        print(ans)
        exit(0)

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

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:
import sys
from fractions import gcd

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
answer = A * B // gcd(A, B)
print(answer)
# 50

Submission status: Accepted

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

if a < b:
    small = a
    big = b
else:
    small = b
    big = a

i = 2    
while True:
    if (small * i) % big == 0:
        print(small * i)
        break
    i += 1

Submission status: Accepted

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

Solution code:
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

Solution code:
#n=int(input())
a,b=map(int,input().split())
#al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(m)]

import fractions
gcd=fractions.gcd(a,b)#最大公約数
lcm=(a*b)//fractions.gcd(a,b)#最小公倍数
print(lcm)

Submission status: Accepted

Solution code:
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#ABC148.C
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: Accepted

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

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions


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


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

Submission status: Accepted

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

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

import fractions
lcm = (a * b) / fractions.gcd(a, b)

lcm = int(lcm)

print(lcm)

Submission status: Accepted

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

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

Submission status: Accepted

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

def gcd(a,b):
    X = max(a,b)
    g=0
    for i in range(1,X+1):
        if a%i == 0 and b%i == 0:
            g = i
    return g




answer = gcd(a,b)
print(int(a*b/answer))

Submission status: Accepted

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

def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y
            y = z
        else:
            return z

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

print(lcm(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
a,b = iim()
import fractions
print(a*b//fractions.gcd(a,b))

Submission status: Accepted

Solution code:
def my_gcd(a, b):
    p = max(a, b)
    q = min(a, b)
    r = p % q
    while r > 0:
        p = q
        q = r
        r = p % q
    return q

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

Submission status: Accepted

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

Submission status: Accepted

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

def gcd(m,n):
  while m > 0 and n > 0:
    if m >= n:
      m = m - n
    else:
      n = n - m
  if m == 0:
    return n
  else:
    return m

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

Submission status: Accepted

Solution code:
a, b = [int(a) for a in input().split(' ')]
m, n = a, b
temp = 1
while m % n != 0:
    temp = n
    n = m % n
    m = temp

result = a * b / n
print(int(result))

Submission status: Accepted

Solution code:
import math  
import fractions


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

#最小公倍数    
def lcm(x, y):
    #return (x * y) // math.gcd(x, y)
    return (x * y) // fractions.gcd(x, y)


print(lcm(A,B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import fractions
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int(): return int(input())

def map_int_input(): return map(int, input())

MII = map_int_input

def MII_split(): return map(int, input().split())

def MII_to_index(): return map(to_index, input())

def MII_split_to_index(): return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs(): return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

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

A, B = MII_split()

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions


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


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

Submission status: Accepted

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


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


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

ans = (A * B) // gcd(A, B)

print(ans)

Submission status: Accepted

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

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

print(lcm(a, b))

Submission status: Accepted

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())
print(int(a * b / gcd(a, b)))

Submission status: Accepted

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())
print(int(a * b / gcd(a, b)))

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

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

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