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:
num = [int(s) for s in input().split()]

com = 1
tes = 2
if max(num)%min(num) == 0:
  print(max(num))
else:
  while tes < min(num)/2 +1:
    if min(num)%tes == 0 and max(num)%tes == 0:
      com *= tes
      num = [int(n/tes) for n in num]
    else:
      tes += 1
  print(com*min(num)*max(num))

Submission status: Accepted

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

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
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
a, b = i2()
c = min(a,b)
d = max(a,b)
for i in range(1,d+1):
    if (c*i)%d == 0:
        print(c*i)
        exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  8 22:20:37 2020

@author: Kanaru Sato
"""

import fractions

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

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

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

Submission status: Accepted

Solution code:
import math

def bunkai(x):
    for i in range(2, int(math.sqrt(x))+1):
        if x%i == 0:
            return [i] + bunkai(x//i)
    return [x]

def snake(a, b):
    a_l = bunkai(a)
    b_l = bunkai(b)
    ans = 1
    for a_i in a_l:
        ans *= a_i
        if a_i in b_l:
            b_l.pop(b_l.index(a_i))
    for b_i in b_l:
        ans *= b_i
    return ans

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

print(snake(a, b))

Submission status: Accepted

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

    x, y = y % x, x
    return gcd(x, y)


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

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

Submission status: Accepted

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

Submission status: Accepted

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

n = m = 1
flg = 0
an = A
bm = B

while flg ==0:
  an = A * n
  bm = B* m
  if an == bm :
    flg = 1
    res = an
  elif an < bm:
    n += 1
  else :
    m += 1 
  
print(an)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import fractions

A,B = [int(i) for i in 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())
print((a * b) // fractions.gcd(a, b))

Submission status: Accepted

Solution code:
import fractions

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

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

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
        
n=a//gcd(a,b)
m=b//gcd(a,b)
print(gcd(a,b)*n*m)

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

Solution code:
import fractions

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

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

def gcd(x,y):
    while y:
        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:
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()))

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

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

from fractions import gcd

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
def gcd(x,y):
    if x==y:
        return x
    elif x>y:
        r=-1
        while r!=0:
            r=x%y
            x=y
            y=r
        return x
    else:
        r=-1
        while r!=0:
            r=y%x
            y=x
            x=r
        return y

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
x=min(A,B)
y=max(A,B)
check=1
##x<=y
#####while break##############
if y%x==0:
    print(y)
#print(root)
else:
    #root=round((x**(1/2)))
    while True:
        through=0
        for i in range(2,int(x)):
            if x%i==0 and y%i==0:
                x/=i
                y/=i
                check*=i 
                through=1
                break
        if through==0:
            break
    print(int(check*x*y))

Submission status: Accepted

Solution code:
def gcd(a, b):
    if b == 0:
        return a
    return 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:
x = list(map(int,input().split(" ")))
a = x[0]
b = x[1]

ab_list = []

if a >= b:
    half_num = a // 2
else:
    half_num = b // 2

for i in range(half_num):
    if a % (i+1) == 0 and b % (i+1) == 0:
        ab_list.append(i+1)

for i in ab_list:
    min_mul = (a * b) / i
print(int(min_mul))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

def lcm(x:int, y:int)->int:
    """
    return Least common multiple (最小公倍数)
    """
    return (x * y) // gcd(x, y)

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
import fractions

a,b=(int(x) for x in input().split())
  
print(a*b // fractions.gcd(a,b))

Submission status: Accepted

Solution code:
import fractions

a,b=(int(x) for x in input().split())
  
print(a*b // fractions.gcd(a,b))

Submission status: Accepted

Solution code:
import fractions
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,len(a)):
	lcm = lcm*a[i]//fractions.gcd(lcm,a[i])
print(lcm)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions

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

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

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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


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

print(int(A * B // float(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:
#!/usr/bin/env python3
import fractions
# import numpy as np
import sys


def solve(A: int, B: int):
    ans = (A * B) // fractions.gcd(A, B)
    # print(np.lcm(A, B))
    print(ans)

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

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

if A<B:
    A=B
    B=swapA

Anext=A
Bnext=B
amari=1

while amari!=0:
    amari=Anext%Bnext
    if amari==0:
        Bnext=Bnext
    else:
        Anext=Bnext
        Bnext=amari

A=A
B=B/Bnext

print(int(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:
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:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)

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

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

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)


'''

'''

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

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

a,b = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b)
print(ans)

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

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

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

Submission status: Accepted

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

def maxk(a,b):
    c=min(a,b)
    d=1
    for i in range(2,c+1):
        if a%i==0 and b%i==0:
            d=i


    return d

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines  

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

Submission status: Accepted

Solution code:
# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import statistics
import string


def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

a,b = splitintinput()
g = hcfnaive(a,b)
print(int(a*b/g))

Submission status: Accepted

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

import fractions

gcd = fractions.gcd(a,b)

print(a*b//gcd)

Submission status: Accepted

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

a,b = map(int,input().split())
if a < b :
    a,b = b,a  
s = koubai(a,b)
print( int ( (a*b) /s ) )

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 eu(x,y):
    x,y = sorted([x,y])
    while y%x != 0:
        y,x = x,y%x
    return x
 

X,Y = map(int,input().split())

print((X*Y)//eu(X,Y))

Submission status: Accepted

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

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import fractions


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, readline().split()))
    print(a * b // fractions.gcd(a, b))


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:

from fractions import*

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


g=gcd(a,b)

print(a*b//g)

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(A * B // gcd(A, B))

Submission status: Accepted

Solution code:
import fractions
def main(a,b):
    g = fractions.gcd(a,b)
    lcm = (a * b) // g
    return lcm
    
a,b = map(int,input().split())
print(main(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())
# a*b = l*d
d = fractions.gcd(a, b)
ans = a*b // d
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

num = list(map(int,input().split()))
mo = fractions.gcd(num[0],num[1])

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

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

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

Submission status: Accepted

Solution code:
# import math これだとエラーになる 3.4なので
from fractions import gcd
a, b = map(int, input().split())

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

def dcd(x, y):
  while 1:
    r = x % y
    if r == 0:
      return y
    x = y
    y = r

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
def gcd(a, b):
    if a > b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return 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:
a, b = map(int, input().split())
def gcd(x, y):
    while x%y != 0:
        x, y = y, x%y
    return y
ans = a * b / gcd(a, b)
print(int(ans))

Submission status: Accepted

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

from fractions import gcd



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

Submission status: Accepted

Solution code:
# coding: UTF-8


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


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

Submission status: Accepted

Solution code:
import fractions
N=list(map(int,input().split()))
print(int(N[0]*N[1]/fractions.gcd(N[0],N[1])))

Submission status: Accepted

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

# 最大公約数
def gcd(a, b):
  if b==0:
     return a
  else:
     r = a%b
     return gcd(b,r)

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

Submission status: Accepted

Solution code:
a,b=sorted(map(int,input().split()))
#ユークリッドの互除法
def gcd(a,b):
    if b==0:
        return a
    #余りが0になったら最後の割る数を出力=lcm
    else:
        return (gcd(b,a%b))
print(int(a*b/gcd(a,b)))

Submission status: Accepted

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

if __name__=="__main__":
    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:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def lcm(a, b):
    return a * b // gcd (a, b)


if __name__ == '__main__':
  a,b=(int(x) for x in input().split())
  print(str(lcm(a,b)))

Submission status: Accepted

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

Submission status: Accepted

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

while b:
    a, b = b, a%b
    
print(x//a)

Submission status: Accepted

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

while c%d != 0:
    tmp = d
    d = c%d
    c = tmp

print(x//d)

Submission status: Accepted

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

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

Submission status: Accepted

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


def abc(A, B):
    return (A*B) // fractions.gcd(A, B)


print(abc(A, B))

Submission status: Accepted

Solution code:
import fractions
def gcd(a,b):
   f=fractions.gcd(a,b)
   f2=a*b//f
   return f2

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

i = list(map(int,input().split()))
A = i[0]
B = i[1]

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

print(ans)

Submission status: Accepted

Solution code:
[A,B] = map(int,input().split())
max_ab = max(A,B)
min_ab = min(A,B)

r = max_ab
s = min_ab

while s != 0:
  r,s = s,r % s
  if s == 0:
    break
print(int(r*(A/r)*(B/r)))

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 = [int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

Solution code:
import fractions
A,B = list(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((a*b) // gcd(a, b))

Submission status: Accepted

Solution code:
A,B=input().split()
A=int(A)
B=int(B)
y=A*B
ls=[]
for i in range(1,max(A,B)):
  if A%i==0 and B%i==0:
    ls.append(i)
g=max(ls)
x=y/g
print(int(x))

Submission status: Accepted

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

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

Submission status: Accepted

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

class LCM():
    #a、bに最小公倍数または最大公約数を求めたい二つの整数の組を入れる
    def __init__(self,a,b):
        if a < b:a,b = b,a
        self.a = a
        self.b = b

    #最大公約数
    def gcd(self):
        a,b = self.a,self.b
        def nono(a,b):
            if a < b:a,b = b,a
            if a % b == 0:return b
            else:return nono(b,a % b)
        return nono(a,b)

    #最小公倍数
    def lcm(self):
        a,b = self.a,self.b
        def nono(a,b):
            if a < b:a,b = b,a
            if a % b == 0:return b
            else:return nono(b,a % b)
        num = nono(a,b)
        return a*b//num

l = LCM(a,b)

print(l.lcm())

Submission status: Accepted

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

A={}
B={}
num=2
out=1

while True:
    if a==1 and b==1:
        break
    if a%num==0:
        A.setdefault(num,0)
        A[num]+=1
        a=a/num
    elif b%num==0:
        B.setdefault(num,0)
        B[num]+=1
        b=b/num
    else:
        num+=1

for i in A.keys():
    if i in B.keys() and A[i]<=B[i]:
        out=out*i**B[i]
    else:
        out=out*i**A[i]
for i in B.keys():
    if i not in A.keys():
        out=out*i**B[i]

print(out)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
  
print(lcm(a,b))

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:
A,B=map(int,input().split())
for i in range(min(A,B),0,-1):
    if A%i==0 and B%i==0:
        g=i
        break
print(A*B//g)

Submission status: Accepted

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


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


def lcm(a, b):
    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:
def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

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

try:
    listA = list(input().split())
    #listA<-[1,2,2,3,1]
    #print(listA)
    #ここに逐次処理を書けばいいと思う。
except:
    quit();
    #または、quit(),os.exit()をして止める。

a=int(listA[0])
b=int(listA[1])

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
import math
def gcd (a,b):
    n = min(a,b)
    m = max(a,b)
    
    b = m % n
    
    while b > 0:
        m = n
        n = b
        b = m % n
    
    return n

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