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())
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 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(x,y): # Least common multiple
    return (x*y)//math.gcd(x,y)
print(lcm(a,b))

Submission status: Accepted

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

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

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:
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
from math import gcd
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

g=math.gcd(a,b)
ans=a*b//g
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 abc(a,b):
  return(a*b//gcd(a,b))
print(abc(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(int(A*B/(math.gcd(A,B))))

Submission status: Accepted

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

Submission status: Accepted

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

print(num1 * num2 // math.gcd(num1, num2))

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from itertools import chain


def gcd(a, b):
    """最大公約数
    """
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    """最小公倍数
    """
    return a * b // gcd(a, b)


def solve(A: int, B: int):
    answer = lcm(A, B)
    return answer


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


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
#h,w=map(int,input().split())
#S=[list(map(int,input().split())) for _ in range(h)]
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())

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

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

Submission status: Accepted

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

Solution code:
import math as mp
a,b=map(int,input().split())
print(a*b//mp.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 os
import heapq
import sys,threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10**5)
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]

def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

def main():
    a,b=inar()
    print(lcm(a,b))




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()
    #threadin.Thread(target=main).start()

Submission status: Accepted

Solution code:
a,b = [int(x) for x in input().split()]

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

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

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    from math import gcd
    a,b=MI()
    print((a*b)//gcd(a,b))
    

main()

Submission status: Accepted

Solution code:
from sys import exit
import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Sep  8 20:45:37 2020

@author: liang
"""
"""
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b, a%b)
"""
from math import gcd

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Sep  8 20:45:37 2020

@author: liang
"""

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

A, B = map(int, input().split())
if A < B:
    A ,B = B, A
print(A*B//gcc(A,B))

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 math
A, B = map(int,input().split())
ans = (A * B) // math.gcd(A, B)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

a, b = map(int, input().split())
ans = np.lcm(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())
def gcd(a, b):
	if b==0:
		return a
	return gcd(b, a%b)
print(A*B//gcd(A,B))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


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


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


def main():
    solve()


if __name__ == '__main__':
    main()

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(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(a, b))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

#print(math.gcd(A,B))

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

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())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))
# 12

Submission status: Accepted

Solution code:
aa, bb = map(int,input().split())

a = aa
b = bb
r = 0
# 最大公約数を求める
while 1:
    a, b = max(a,b), min(a,b)
    a = a % b
    if a == 0:
        r = b
        break

print(aa//r*bb)

Submission status: Accepted

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

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

# 最小公倍数lcmと最大公約数gcdに成り立つ関係：gcd(a,b)*lcm(a,b)=ab を用いる
print(a * b // math.gcd(a, b))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
 
# aの倍数を順に探索する
# abはa, bの公倍数なので、高々B回で十分。O(B)
lcm = 0
for i in range(1, b+1):
  if (a * i) % b == 0:
    lcm = a * i
    break
  
print(lcm)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = list(map(int, input().split(' ')))
# m = int(input())
for i in range(1, 10**5):
    if (N[0] *i)%N[1] == 0:
        print(N[0]*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=map(int,input().split())
print (a*b//math.gcd(a,b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)#/にするとfloatになるため。

print(lcm(A, B))

Submission status: Accepted

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

lcm(a,b)

Submission status: Accepted

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

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 sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from math import gcd

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
times = A * B
if A < B:
  A, B = B, A
while B > 0:
  temp = A % B
  A = B
  B = temp
print(int(times/A))

Submission status: Accepted

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

import math

c = math.gcd(A,B)

d = (A*B) / c 

print(int(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def factorization(n):
    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
A,B = map(int,input().split())
Afac = factorization(A)
Bfac = factorization(B)
Ans = {}
for i in range(len(Afac)):
    Af = Afac[i]
    if Af[0] not in Ans:
        Ans[Af[0]] = Af[1]
    else:
        Ans[Af[0]] = Af[1]
for j in range(len(Bfac)):
    Bf = Bfac[j]
    if Bf[0] not in Ans:
        Ans[Bf[0]] = Bf[1]
    else:
        Ans[Bf[0]] = max(Bf[1],Ans[Bf[0]])
Answer = 1
for n, m in Ans.items():
    Answer *= n**m
print(Answer)

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split()) 
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
ans = lcm(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:
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:
a,b=map(int,input().split())

#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

print(lcm(a,b))

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
e=a
d=b
c=1
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: 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())
lcm=(A*B)//math.gcd(A,B)

print(lcm)

Submission status: Accepted

Solution code:
from fractions import gcd
from functools import reduce
AB = list(map(int, input().split()))

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

def lcm(a):
    return reduce(lcm_base,a,1)
print(lcm(AB))

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


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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

abc148c_snack()

Submission status: Accepted

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

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:
import math

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

c = math.gcd(a, b)

print(a*b // c)

Submission status: Accepted

Solution code:
from fractions import gcd


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


def gcd(x, y):
  b = max(x, y)
  s = min(x, y)
  r = b % s
  while r != 0:
    b = s
    s = r
    r = b % s
  return s
 
def lcm(x, y):
  return (x * y) // gcd(x,y)


ans = lcm(x,y)

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:
A,B = map(int,input().split())
import math
ans = A*B/math.gcd(A,B)
print(int(ans))

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

import math
from functools import reduce

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

print(lcm_base(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:
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())
num=1
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        num=i
print(int(A*B/num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

from numpy.compat.py3k import asstr
a, b = map(int, input().split())
ans = int(a * b / math.gcd(a, b))
print(str(ans))

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:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(A: int, B: int):
    def lcm(x, y):
        return (x * y) // math.gcd(x, y)
    return lcm(A, B)


def main():

    sys.setrecursionlimit(10 ** 6)

    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
    print(f'{solve(A, B)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

import math

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


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

print(lcm(x,y))

Submission status: Accepted

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


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


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


print(lcm(a, b))

Submission status: Accepted

Solution code:
a,b=[int(x) for x in input().split()]
import math
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())
if a >= b:
    i = 1
    while i > 0:
        if (a*i) % b == 0:
            print(a*i)
            break
        i += 1
else:
    i = 1
    while i > 0:
        if (a*i) % b == 0:
            print(a*i)
            break
        i += 1

Submission status: Accepted

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

Submission status: Accepted

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

import math
#最小公倍数(mathのimportが必要)
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:
def gcd(a,b):
    while a!=0 and b!=0:
        if a>b:
            c = a
            a = b
            b = c
        b %= a
    return max(a,b)

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

if a%b == 0:
    ans = a
elif b%a == 0:
    ans = b
else:
    ans = int(a*b / math.gcd(a, b))

print(ans)

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) 

if __name__ == "__main__":
    n1,n2=map(int,input().split(' '))
    print(int(lcm(n1,n2)))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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

# リストのlcm
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

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


main()

Submission status: Accepted

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

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):
    if not a%b:
        return b
    return gcd(b,a%b)
a,b = map(int, input().split())
print(a*b//gcd(max(a,b),min(a,b)))

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a,b = inpm()

#lcm
def lcm(A):
    x = A[0]
    for a in A:
        x = (x * a) // math.gcd(x, a)
    return x

print(lcm([a,b]))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

print(lcm(x,y))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(int(A * B / math.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:
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:
def main():
    import math
    a, b = map(int, input().split())
    ans = a * b // math.gcd(a, b)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
# from fractions import gcd
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

# N = I()
A,B = LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

# 最小公倍数 = A * B // 最大公約数
ans = A * B // math.gcd(A,B)
print(ans)

# if ans:
#     print('Yes')
# else:
#     print('No')

Submission status: Accepted

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

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:

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 = input().split()
a = int(a)
b = int(b)
print(int(lcm(a,b)))

Submission status: Accepted

Solution code:
def gcd(s,t):
    if t==0:
        return s
    else:
        return gcd(t, s%t)

s, t = [int(x) for x in input().split()]

GCD = gcd(s,t)
LCM = (s*t)//GCD
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:
A, B = map(int, input().split())

s = add = max(A, B)
while True:
    if s % A == 0 and s % B == 0:
        break
    s += add

print(s)

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
x = 1
while True:
	a = A * x
	if a % B == 0:
		print(a)
		break
	x += 1

Submission status: Accepted

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

import sys
from math import gcd
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


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

gc = gcd(A, B)
LCM = A * B // gc

print(LCM)

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