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())
Ans = 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(Ans / B))

Submission status: Accepted

Solution code:
from fractions import gcd

N = input().split()

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

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

print(lcm)

Submission status: Accepted

Solution code:
import fractions

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

print(int(a[0]*a[1]/fractions.gcd(a[0],a[1])))

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
gcc=1
i=2
while True:
    if(a<i or b<i):
        break
    elif (a%i==0 and b%i==0):
        gcc*=i
        a/=i
        b/=i
        i=2
    else:
        i+=1

print(int(a*b*gcc))

Submission status: Accepted

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

_A, _B = min(A, B), max(A, B)

pres = _A
while True:
    res = _B % _A
    if res == 0:
        break
    else:
        pres = res
        _B = _A
        _A = res

print((A * B) // pres)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
max_one = max(A,B)
min_one = min(A,B)
for i in range(1,min_one+1):
    moi = max_one * i
    if moi % min_one == 0:
        print(moi)
        break

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

Solution code:
def gcd(a,b):
    if b == 0:
        return a
    elif a<b:
        return gcd(b,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 fractions
A,B = map(int,input().split())

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

Submission status: Accepted

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

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

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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import fractions

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

f=fractions.gcd(a,b)

f2=a*b//f

print(f2)

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

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

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

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

ans = lcm(a, b)

print(ans)

Submission status: Accepted

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

def gcd(a, b):
    if a < b:
        tmp = b
        b = a
        a = tmp
        
    while a % b != 0:
        r = a % b
        a, b = b, r
        
    return b

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

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

def LCM(a, b):
    return int((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=map(int,input().split())
maxi=max(a,b)
mini=min(a,b)
gg=gcd(mini,maxi)
maxii=maxi//gg
minii=mini//gg
print(maxii*mini)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB = [int(e) for e in input().split()]
A = AB[0]
B = AB[1]
cnt = 1
while 1:
    if ((A * cnt) % B)==0:
        ans = A * cnt
        break
    cnt+=1
print(ans)

Submission status: Accepted

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

n = max(a,b)
m = min(a,b)
ans=0

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

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:
"""
Atcoder_Beginner_Contest_148
C

"""
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000)

A, B = map(int, input().split())
tmp_a, tmp_b = A, B
while tmp_a % tmp_b != 0:
    tmp_a, tmp_b = tmp_b, tmp_a % tmp_b

print(int(A * B / tmp_b))

Submission status: Accepted

Solution code:
from fractions import gcd
import sys

input = sys.stdin.readline

a, b = list(map(int, input()[:-1].split(" ")))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
def gcd(a, b):
    if a < 0: a = -a
    if b < 0: b = -b
    while b > 0:
        (a, b) = (b, a % b)
    return a

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

Submission status: Accepted

Solution code:
#!python3.4.3
from fractions import gcd

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

if __name__ == "__main__":
    a, b = map(int, input().split(' '))
    
    print(lcm(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:
a,b = map(int, input().split())
i = min(a,b)
s = 0
while(i <= a*b):
    if (i%a == 0 and i%b == 0):
        s = i
        break
    i += min(a,b)
print(i)

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

n = list(map(int, input().split()))

a = (n[0] * n[1]) // fractions.gcd(n[0], n[1])
print(a)

Submission status: Accepted

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

def euc(a,b):
    euc1 = max(a,b)
    euc2 = min(a,b)
    rem = euc1 % euc2#余り
    if rem == 0:
        return euc2
    else:
        return euc(euc2,rem)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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


print(A*B//fractions.gcd(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
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())

min = a * b / fractions.gcd(a, b)

print(int(min))

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
try:
    A,B = map(int,input().split())
    def lcm(x, y):
        return (x * y) // fractions.gcd(x, y)
    print(lcm(A,B))
except EOFError:
    pass

Submission status: Accepted

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

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

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
A, B = [int(num) for num in input().split()]
max = A * B

bigger = None
smaller = None
if A > B:
    bigger = A
    smaller = B
else:
    bigger = B
    smaller = A

for i in range(1, smaller + 1):
    num = bigger * i

    if not num % smaller:
        print(num)
        break

Submission status: Accepted

Solution code:
u = input().split()
c = int(u[0])
d = int(u[1])
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(c,d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
# import string
import fractions
from fractions import Fraction
from fractions import gcd

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

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq


# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace

# from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# # from itertools import accumulate
# # from collections import deque

# from operator import mul
# from functools import reduce

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import fractions

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

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

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

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

print(okasi(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())
s = max(a,b)
m = max(a,b)

for i in range(s,10**10+1,m):
    if i%a == 0 and i%b ==0:
        print(i)
        exit()

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

Submission status: Accepted

Solution code:
import fractions

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

    return ans

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

print(lcm(A, B))

Submission status: Accepted

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

print(lcm([a,b]))  # 実行結果: 12

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    print(ans)


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

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

Submission status: Accepted

Solution code:
def hcf(a,b):
	if(a==0):
		return b
	if(b==0):
		return a
	return hcf(b%a,a)
import math
a,b = list(map(int,input().split()))
print(abs(a*b)//hcf(a,b))

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 fractions

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

n = a * b / fractions.gcd(a, b)

print(int(n))

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



lcd_ab = (a*b) // fractions.gcd(a,b) 

print(lcd_ab)

Submission status: Accepted

Solution code:
def primeFactorization(n):
    num = n
    tmp = 3
    result = []
    
    while num % 2 == 0:
        result.append(2)
        num //= 2
    
    while tmp * tmp <= num:
        while num % tmp == 0:
            result.append(tmp)
            num //= tmp
        tmp += 2
    
    if tmp != 1:
        result.append(num)
    
    return result

if __name__ == "__main__":
    ab = input().split(" ")
    a = primeFactorization(int(ab[0]))
    b = primeFactorization(int(ab[1]))
    
    result = 1
    ptr_a = 0
    ptr_b = 0
    while ptr_a < len(a) and ptr_b < len(b):
        if a[ptr_a] == b[ptr_b]:
            result *= a[ptr_a]
            ptr_a += 1
            ptr_b += 1
        elif a[ptr_a] < b[ptr_b]:
            result *= a[ptr_a]
            ptr_a += 1
        else:
            result *= b[ptr_b]
            ptr_b += 1

    while ptr_a < len(a):
        result *= a[ptr_a]
        ptr_a += 1
    while ptr_b < len(b):
        result *= b[ptr_b]
        ptr_b += 1

    print(result)

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

import fractions

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

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

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

Submission status: Accepted

Solution code:
import sys
from pprint import pprint
import fractions

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

def solve(a, b):
    print(lcm(a, b))

if __name__ == '__main__':
    a, b = map(int, sys.stdin.readline().strip().split(" "))
    solve(a, b)

Submission status: Accepted

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

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

Submission status: Accepted

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

a=input().split(" ")
a[0]=int(a[0])
a[1]=int(a[1])

print(int(a[0]*a[1]/fractions.gcd(a[0], a[1])))

Submission status: Accepted

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

import sys
import math
import itertools

debug = False

def log(text):
    if debug:
        print(text)


def gcd(a, b):

    c = min(a, b)
    d = max(a, b)
    r = 0    
    while True:
        r = d % c
        if r == 0:
            break
        d = c
        c = r

    return c

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


def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # error?
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())

    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    

    (a, b) = [int(e) for e in lines[0].split(" ")]

    return (a, b)


def solve(a, b):

    
    return lcm(a, b)


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

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

Submission status: Accepted

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

def solve(a,b):
	if b == 0:
		return a
	return solve(b, a%b)
print(a*b//solve(a,b))

Submission status: Accepted

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
M=max(A,B)
m=min(A,B)
r=M%m
while r!=0:
  M=m
  m=r
  r=M%m
a1=A//m
b1=B//m
print(a1*b1*m)

Submission status: Accepted

Solution code:
A, B = list(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:
from fractions import gcd
(A, B), = [list(map(int, s.split())) for s in open(0)]
print(int(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(x, y):
    return (x * y) // gcd(x, y)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
import fractions


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

Submission status: Accepted

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


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


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


print(lcm(A, B))

Submission status: Accepted

Solution code:
from sys import stdin 
import fractions
a,b = [int(x) for x in stdin.readline().rstrip().split()]
answer = a * b // fractions.gcd(a, b)
print(answer)

Submission status: Accepted

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

m,n = input().split()
m = int(m)
n = int(n)

print(lcm(m,n))

Submission status: Accepted

Solution code:

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(m,n):
    return int(m * n/gcd(m,n))

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

Submission status: Accepted

Solution code:
import fractions

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

result = a * b / fractions.gcd(a, b)

print(int(result))

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)

m, n = map(int, input().split())

print(lcm(m,n))

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 math
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)
  if temp!=1:
    arr.append(temp)
  if arr==[]:
    arr.append(n)
  return arr

def main():
  a,b = map(int,input().split())
  a_ary = factorization(a)
  b_ary = factorization(b)
  
  result = 1
  for n in a_ary:
    result *= n
    if (n in b_ary):
      i = b_ary.index(n)
      b_ary.pop(i)
  for n in b_ary:
    result *= n
  
  print(result)

main()

Submission status: Accepted

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

a, b = [int(i) for i in input().split()]
small = min(a,b)
big = max(a,b)

multi = 1
ans = big
while True:
    ans = big * multi
    if (ans % small) == 0:
        break
    multi += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(lcm(a,b))

Submission status: Accepted

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


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

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

input_line = input().split()

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

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

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

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

print(lcm(A, B))

Submission status: Accepted

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

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

Submission status: Accepted

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

while B:
    A,B = B,A%B

print(r//A)

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

Solution code:
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]

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 = fetch_int_input()
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(a, b)
print(lcm(a, b))

Submission status: Accepted

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

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

a, b = [int(val) for val in input().split(' ')]
lcm = int((a*b)/gcd(a, b))
print(lcm)

Submission status: Accepted

Solution code:
import fractions

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


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


solve()

Submission status: Accepted

Solution code:

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

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 fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
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(X//B)

Submission status: Accepted

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

A, B = (int(i) for i in input().split())
print(int(A*B / gcd(A, B)))

Submission status: Accepted

Solution code:
from fractions import gcd
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    print((A * B) // gcd(A, B))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a1 = [0 for i in range(100005)]
b1 = [0 for i in range(100005)]
x = 2
while a != 1:
    if not (a % x):
        a = a // x
        a1[x] += 1
    else:
        x += 1
x = 2
while b != 1:
    if not (b % x):
        b = b // x
        b1[x] += 1
    else:
        x += 1
lcm = 1
for i in range(100003):
    if a1[i] or b1[i]:
        lcm *= pow(i, max(a1[i], b1[i]))
print(lcm)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000)

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:
from fractions import gcd
A,B=map(int, raw_input().split())

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

print lcm(A,B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import fractions

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

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

print(lcm(A, B))

Submission status: Accepted

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


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

print(lcm(a, b))