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

def gcd(A,B):
    if A < B:
        A, B = B, A
    while A % B > 0:
        r = A % B
        A,B = B,r
    return B

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ar = []
br = []
while a % 2 == 0:
    a /= 2
    ar.append(2)
f = 3
while a > 1:
    if(a % f == 0):
        a /= f
        ar.append(f)
    else:
        f += 2
while b % 2 == 0:
    b /= 2
    br.append(2)
f = 3
while b > 1:
    if(b % f == 0):
        b /= f
        br.append(f)
    else:
        f += 2

y = list(set(ar + br))
s = []
for i in y:
    s.append(i**max([ar.count(i),br.count(i)]))
p = 1
for i in s:
  p *= i
print(p)

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
def gcd(a,b):
    x = max(a, b)
    y = min(a, b)
    if x%y == 0:
        return y
    else:
        while x%y !=0:
            z =x%y
            x =y
            y =z
        else:
            return z

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

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

Submission status: Accepted

Solution code:
l = list(int(x) for x in input().split())
l.sort(reverse=True)

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
gcd = gcd(l[0],l[1])

def lcm(a,b):
  return a*b//gcd
print(lcm(l[0],l[1]))

Submission status: Accepted

Solution code:
a = [int(i) for i in 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[0],a[1]))

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 math

li=list(map(int,input().split()))
max_=max(li[0],li[1])

a=[0 for i in range(max_+1)]
b=[0 for i in range(max_+1)]

for i in range(2,li[0]+1):
  while(li[0]%i==0 and li[0]!=1):
    li[0]//=i
    a[i]+=1
for i in range(2,li[1]+1):
  while(li[1]%i==0 and li[1]!=1):
    li[1]//=i
    b[i]+=1

result=1
for i in range(1,max_+1):
  max_num=max(a[i],b[i])
  result*=i**max_num
print(result)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
aa = []
bb = []

count = 2

while True:
  if a == 1:
    aa.append(a)
    break
  if a%count == 0:
    aa.append(count)
    a = a//count
  else:
      count += 1
    
count = 2

while True:
  if b == 1:
    bb.append(b)
    break
  if b%count == 0:
    bb.append(count)
    b = b//count
  else:
      count += 1
answer = 1
c = set(aa) | set(bb)
for i in c:
  answer *= i ** max(aa.count(i), bb.count(i))
print(answer)

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

Submission status: Accepted

Solution code:
import fractions as fra
n,m=map(int,input().split())
print((n*m)//fra.gcd(n,m))

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:
def PGCD(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def ppcm(a,b):
    return a*b//PGCD(a,b)
A,B = map(int,input().split())
print(ppcm(A,B))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if A >= B:
    maxi = A
    mini = B
else:
    maxi = B
    mini = A

ans = mini

while(1):
    if ans % A == 0 and ans % B == 0:
        break
    ans += mini

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
A, B = [int(n) for n in input().split()]
x = max(A, B)
y = min(A, B)
N = 10**5+1
for i in range(1, N):
    if (x*i)%y == 0:
        print(x*i)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
import fractions

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#バージョン的にfractionsにある
import fractions

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
#impout math
        
A,B = [int(x) for x in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc148/tasks/abc148_c
import fractions
# math.gcdは3.5からなのでAtCoderで使えない
# import math


def main():
    (a, b) = [int(i) for i in input().split(" ")]
    print(int(a * b / fractions.gcd(a, b)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=a
d=b
if a<b:
    tmp=a
    a=b
    b=tmp
r=a%b
while r!=0:
    a=b
    b=r
    r=a%b
ans=round((c*d)/b)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=input().split()
a=int(A)
b=int(B)
def gcd(s,t):
	while t:
		s,t=t,s%t
	return s
def lcm(s,t):
	return s*t//gcd(s,t)
print(lcm(a,b))

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)
ab = list(map(int,input().split()))
a = ab[0]
b = ab[1]
print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
aList = {}
bList = {}
result = 0

i = 1
while result == 0:
    aList[a * i] = 0
    bList[b * i] = 0
    if (b * i) in aList:
        result = b * i
    elif (a * i) in bList:
        result = a * i
    i += 1
print(result)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
import fractions
print(int(A*B/fractions.gcd(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:
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 = [int(i) for i in input().split()]
print(lcm(a, b))

Submission status: Accepted

Solution code:
import fractions

s = raw_input().split()

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

#print A, B

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

Submission status: Accepted

Solution code:
import fractions

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

k = fractions.gcd(a, b)

ans = (a * b) // k

print(ans)

Submission status: Accepted

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

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

print(lcm(a, b))
"""

a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
      ans = ans * a[i] // fractions.gcd(ans, a[i])
      print(ans)
"""

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

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

# Aの倍数を1倍からB倍まで列挙して、それがBの倍数であるものを選ぶ
for b in range(1, B + 1):
    A_x = b * A
    if A_x % B == 0:
        print(A_x)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
def multiple(a, b):
    return a*b // euclid(a, b)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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 = [int(i) for i in input().split()]
print(int(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:
A,B = map(int,input().split())

flg = True

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

Submission status: Accepted

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

if a>b:
	tmp = a
	a=b
	b=tmp

r=a%b
while r!=0:
	a=b
	b=r
	r=a%b
	
print(int(x/b))

Submission status: Accepted

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

def solve():
  ans = (a * b) // gcd(a, b)
  print(ans)

def main():
  solve()


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
x=a*b
if(a<b):
    a,b=b,a
r=a%b
while(r!=0):
    a=b
    b=r
    r=a%b
print(int(x/b))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

print(lcm([A, B]))

Submission status: Accepted

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

if a < b:
    tmp = a
    a = b
    b =tmp
r = a%b
while(r != 0):
    a = b
    b = r
    r = a % b

print(int(x/b))

Submission status: Accepted

Solution code:
import fractions
import math

a,b = map(lambda x:int(x), input().split())


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

Submission status: Accepted

Solution code:
input_data = input().split(' ')

data = [int(input_data[i]) for i in range(2)]
if(data[0] < data[1]):
    local = data[0]
    data[0] = data[1]
    data[1] = local

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


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

print(lcm(data[0], data[1]))

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

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

Submission status: Accepted

Solution code:
import sys
import fractions

str = sys.stdin.readline()

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

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

Submission status: Accepted

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

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

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

print(lcm(a, b))

Submission status: Accepted

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

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(int(lcm(A,B)))

Submission status: Accepted

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


def gcd(m, n):
    if (m < n):
        return gcd(n, m)
    elif (n == 0):
        return m

    return gcd(n, m % n)


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

def getEuclideanAlgorithm(i, j):
    r = i % j
    while (r != 0):
        i = j
        j = r
        r = i % j
    return j

if (num[0] < num[1]):
    gcd = getEuclideanAlgorithm(num[1], num[0])
else:
    gcd = getEuclideanAlgorithm(num[0], num[1])

print(int((num[0] * num[1]) / gcd))

Submission status: Accepted

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

def euclid(a0, b0):
    a = max(a0, b0)
    b = min(a0, b0)
    while(a%b != 0):
        a = a%b
        if a<b: # 入れ替え
          a = a^b
          b = a^b
          a = a^b
        #print(a,end=" ")
        #print(b)
    return b

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

Submission status: Accepted

Solution code:
def gcd(m,n):
  while n!=0: n, m = m % n, n
  return m
A,B = map(int, input().split())
print(A*B//gcd(max(A,B),min(A,B)))

Submission status: Accepted

Solution code:
x, y = list(map(int, input().split()))

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(x, y))

Submission status: Accepted

Solution code:
a,b=[int(x) for x in input().rstrip().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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L=input().split(' ')

X = int(L[0])
Y = int(L[1])

if X < Y:
    tmp = Y
    Y = X
    X = tmp

M = X*Y

R = X%Y
while(R!=0):
    X=Y
    Y=R
    R=X%Y
    
print(int(M/Y))

Submission status: Accepted

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

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

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import math
from fractions import gcd

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

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

Submission status: Accepted

Solution code:
aa,bb = map(int,input().split())
a = aa
b = bb
if aa>bb:
    a = bb
    b = aa
rx = a
ry = b

while 1:
    if rx == 0:
        break
    rx2 = ry%rx
    ry = rx
    rx = rx2

print(int(a*b/ry))

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) 

arr = list(map(int, input().split()))
print(int(lcm(arr[0],arr[1])))

Submission status: Accepted

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

print(lcm(a ,b))

Submission status: Accepted

Solution code:
import sys
from math import sqrt as sq

def main():
    l=[int(e) for e in list(sys.stdin.readline().split())]
    if l[0]>l[1]:
        l=l[::-1]
    for e in range(l[0],0,-1):
        if l[0]%e==0:
            tempQ1=l[0]//e
            if l[1]%e==0:
                tempQ2=l[1]//e
                print(tempQ1*tempQ2*e)
                break


main()

Submission status: Accepted

Solution code:
import collections

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

a, b = map(int, input().split())
af = factorize(a)
bf = factorize(b)
ac = collections.Counter(af)
bc = collections.Counter(bf)
pnum = set(ac.keys()) | set(bc.keys())

ans = 1
for i in pnum:
    ans *= i**(max(ac[i], bc[i]))
print(ans)

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

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
#!python3

def resolve():
    A, B = map(int, input().rstrip().split(" "))

    a = b = 2
    X = A
    Y = B
    while True:
        if X == Y:
            break
        elif X < Y:
            X += A
        else:
            Y += B

    print(X)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

def gcb(a,b):
  x = max(a,b)
  y = min(a,b)
  if x%y ==0:
    return y
  else:
    while x%y!=0:
      z = x%y
      x = y
      y = z
    else:
      return z
def lcm(a,b):
  return int(a * b / gcb(a,b))

print(lcm(A,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())

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

  
x = a * b
r = a % b
while r != 0:
  a = b
  b = r
  r = a % b

print(int(x/b))

Submission status: Accepted

Solution code:

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

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(x) for x in input().split()]


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

Submission status: Accepted

Solution code:
from fractions import gcd

def saisyou(x, y):
    ans =  (x * y) // gcd(x, y)
    print(ans)

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

Submission status: Accepted

Solution code:
def main(a: int, b: int):
    x, y = 1, 1

    while (a * x) != (b * y):
        if (a * x) > (b * y):
            y += 1
        else:
            x += 1

    print(a * x)


if __name__ == "__main__":
    a, b = map(int, input().split())

    main(a, b)

Submission status: Accepted

Solution code:
import fractions
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:
def gcd(a,b):
	if b == 0:
		return a
	return gcd(b,a%b)
a,b = [int(x) for x in input().split()]
print((a*b)//gcd(a,b))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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) 

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

    print(int(lcm(A,B)))

if __name__ == "__main__":
    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())

def gcd(a,b):#最大公約数
  return a if b == 0 else gcd(b,a%b)
answer=A*B//gcd(A,B)
print(answer)

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

# 2数を受け取って最小公倍数を返す関数
#最大公約数
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:
import fractions

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

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

print(lcm(a, b))

Submission status: Accepted

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

#a,bの最小公倍数
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
from math import factorial
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
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()))
MOD = 10**9 + 7

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

Submission status: Accepted

Solution code:
import math

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

def computeGCD(x, y): 
    if x > y: 
        small = y 
    else: 
        small = x 
    for i in range(1, small+1): 
        if((x % i == 0) and (y % i == 0)): 
            gcd = i 
              
    return gcd

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

print(lcm(A, B))

Submission status: Accepted

Solution code:

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

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

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

print(int(lcm(a, b)))

Submission status: Accepted

Solution code:
import fractions

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

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

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
x = max(A, B)
y = min(A, B)
if x%y == 0:
  gcd = y
else:
  while x%y != 0:
    z = x%y
    x = y
    y = z
  else:
    gcd = z
lcm = int(A*B/gcd)

print(lcm)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

print(lcm(x, y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

test = ""
#test = \
"""
123 456
"""
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
    

a, b = map(int, input2().strip().split())
print(a * b // fractions.gcd(a, b))

Submission status: Accepted

Solution code:
a,b = map(lambda x: int(x), input().split())
c = a
d = b
if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b

print(c*d // b)

Submission status: Accepted

Solution code:
#C
import fractions
a, b = map(int, input().split())
if a < b : a, b = b, a #a > b
if a // b == a/b:
    ans = a
else:
    ans = a * b / fractions.gcd(a,b)
print(int(ans))

Submission status: Accepted

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

print((x * y) // gcd(x, y))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
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 = [int(x) for x in input().split(" ")]
 
print(lcm(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])

mo = 0
if A >= B:
    mo = gcd(A, B)
else:
    mo = gcd(B, A)
ans = (A * B) // mo

print(ans)

Submission status: Accepted

Solution code:
import fractions

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

gcd=fractions.gcd(a,b)

n=a*b/gcd

print(int(n))

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

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

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

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 unittest


class TestC(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(2, 3), 6)

    def test_2(self):
        self.assertEqual(think(123, 456), 18696)

    def test_3(self):
        self.assertEqual(think(100000, 99999), 9999900000)


def solve():
    a, b = read()
    result = think(a, b)
    write(result)


def read():
    return read_int(2)


def read_int(n):
    return read_type(int, n)


def read_float(n):
    return read_type(float, n)


def read_type(t, n):
    return list(map(lambda x: t(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b):
    return lcm(a, b)


def write(result):
    print(result)


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


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


if __name__ == '__main__':
    # unittest.main()
    solve()

Submission status: Accepted

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

def NonRecursiveGcd(x,y):
 
    while(y):
        x , y = y , x % y
    return x 
def computeLcmWithNonRecursiveGcd(x,y):
    
    lcm = (x*y)//NonRecursiveGcd(x,y)
    
    return lcm  
print(computeLcmWithNonRecursiveGcd(a,b))

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:
a,b = map(int,input().split())
n = a*b
if a < b:
  tmp = a
  a = b
  b = tmp
tmp = a % b
while tmp != 0:
  a = b
  b = tmp
  tmp = a % b

print(n//b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
A, B = map(int, input().split())

a = A
b = B
while True:
    r = a % b
    if r == 0:
        break
    a = b
    b = r

lcm = (A*B)/b



# 出力
print(int(lcm))

Submission status: Accepted

Solution code:
# coding: utf-8

a, b = (int(n) for n in input().split())

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

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

Submission status: Accepted

Solution code:
import fractions
def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)
A,B = list(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
s = input().split()
a = int(s[0])
b = int(s[1])
re = int(a*b/gcd(a, b))
print(re)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a<b:
  n=a
else:
  n=b
  
x=1

for i in range(2,n+1):
  while 1:
    if (b/x)%i==0 and (a/x)%i==0:
      x=x*i
    else:
      break
  
print(int(a*b/x))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
X = A*B
if A < B:
    temp = A
    A = B
    B = temp

r = A % B
while r != 0:
    A = B;
    B = r;
    r = A % B

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

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

Submission status: Accepted

Solution code:
a, b = input().split()
x = a = int(a); y = b = int(b)
c = a % b
while c != 0:
    a, b = b, c
    c = a % b
print(x // b * y)