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

Solution (Python):



def greatest_common_divisor(bigger, smaller):
    
    if bigger < smaller:
        bigger, smaller = smaller, bigger
    while bigger % smaller != 0:
        bigger, smaller = smaller, bigger % smaller
    
    return smaller
    

def main():
    
    a, b = map(int, input().split(' '))
    least_common_multiple = a * b // greatest_common_divisor(a, b)
    print(least_common_multiple)
    
    return 0
    
    
if __name__ == '__main__':
    main()

Solution (Python):
import fractions

x,y = map(int,input().split()) 
G = fractions.gcd(x,y)
print(x*y//G)

Solution (Python):
'''input
123 456
'''

from sys import stdin
from collections import defaultdict

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


a, b = list(map(int, stdin.readline().split()))

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

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

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

Solution (Python):
A, B = list(map(int, input().split()))
if A > B:
  n = A
else:
  n = B
q = list(range(1, n+1))
divisor = []
for i in q:
  if A % i == 0 and B % i == 0:
    divisor.append(i)
gcd = max(divisor)
lcm = int(A * B / gcd)
print(lcm)

Solution (Python):

import fractions


def main():
    a, b = map(int, input().split(' '))
    
    print(a * b // fractions.gcd(a, b))
    
    return 0
    
    
if __name__ == '__main__':
    main()

Solution (Python):
def saidai_kouyakusu(a, b):
    a_ = max(a, b)
    b_ = min(a, b)
    q = a_ % b_
    if q == 0:
        return b_
    else:
        return saidai_kouyakusu(b_, q)
      
a, b = input().split()
a = int(a)
b = int(b)
print(a * b // saidai_kouyakusu(a, b))

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

a, b = A, B
while a != b:
    if a < b:
        a += A
    else:
        b += B

print(a)

Solution (Python):
input_line = input().split(' ')
numA = int(input_line[0])
numB = int(input_line[1])

def gcd(a, b):
  if b > a:
    tmp = b
    b = a
    a = tmp
  while True:
    rem = a % b
    if rem == 0:
      break
    else:
      a = b
      b = rem
  return b

gcd = gcd(numA, numB)
divA = numA // gcd
divB = numB // gcd

print(gcd * divA * divB)

Solution (Python):
import fractions

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

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

print(lcm(a, b))

Solution (Python):
import fractions

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

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

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

Solution (Python):


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


def saisho_kouyakusu(a, b):
    a, b = max(a, b), min(a, b)
    if a%b==0:
        return b
    else:
        return saisho_kouyakusu(b,a%b)

skys=saisho_kouyakusu(A,B)
Ad=A/skys
print(int(Ad*B))

Solution (Python):
A, B = map(int, input().split())
if A > B:
    G = A
    S = B
else:
    G = B
    S = A
ans = G
while ans % S != 0:
    ans += G

print(ans)

Solution (Python):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial
sys.setrecursionlimit(200000)
input = sys.stdin.readline

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







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

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

Solution (Python):

from collections import deque
import numpy as np
import math



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




def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = deque()
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return list(divisor_list)


div_A = make_divisor_list(A)
div_B = make_divisor_list(B)

rem = [b for b in div_B if b not in div_A]

if len(rem) != 0:
    for b in [b for b in div_B if b not in div_A]:
        if A * b % B == 0:
            res = A * b
            break
else:
    res = A


print(res)

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

Solution (Python):
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

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

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

Solution (Python):
A, B = map(int, input().split())
i = 1
while True:
    if (A * i) % B == 0:
        print(A * i)
        exit(0)
    i += 1

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

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

Solution (Python):
import fractions
i=list(map(int, input().split()))
a=i[0]
b=i[1]
c=fractions.gcd(a,b)
print(i[0]*i[1]//c)

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

Solution (Python):
import fractions


class Solution:
    def solve(self, a: int, b: int) -> int:

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


if __name__ == '__main__':

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

    
    solution = Solution()
    print(solution.solve(a, b))

Solution (Python):
def pgcd(a,b):
    if b==0:
        return a
    else:
        return pgcd(b,a%b)
def ppcm(a,b):
    return (a*b)//pgcd(a,b)
a,b=map(int,input().split())
print(ppcm(a,b))

Solution (Python):
import fractions

s = list(input().split())

participants_num_A = int(s[0])
participants_num_B = int(s[1])

print(participants_num_A * participants_num_B // fractions.gcd(participants_num_A, participants_num_B))

Solution (Python):
import fractions
a, b = map(int,input().split())
def jk(j,k):
    return j*k//fractions.gcd(j,k)
print(jk(a, b))

Solution (Python):
a, b = (int(x) for x in input().split())
if a > b:
    c = a
    a = b
    b = c
ans = a
c = b
while True:
    if ans == c: break
    elif ans > c: c += b
    ans += a
print(ans)

Solution (Python):
from fractions import gcd

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

print(res)

Solution (Python):
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))

Solution (Python):
from fractions import gcd

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

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

Solution (Python):
import fractions

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

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

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

def gcd(n,m):
    while m:
        n, m = m, n % m
    return n

def lcm(n,m):

    return (n*m) // gcd(n,m)

print(lcm(a,b))

Solution (Python):
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))

Solution (Python):
from sys import stdin
import fractions

A, B = [int(x) for x in stdin.readline().rstrip().split()]

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

Solution (Python):
import fractions

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

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

Solution (Python):
import sys
a, b = input().split()

A = int(a)
B = int(b)

Adiv = A
Bdiv = B
k = 0




for i in reversed(range(min([A, B]))):
    j = i+1
    if Adiv % j == 0 and Bdiv % j == 0:
        k = j
        break


if k == 0:
    k = 1


res = A * B / k

print(int(res))

Solution (Python):
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))

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

Solution (Python):
a, b = map(int, input().split())
i = 1
while True:
  if a * i % b == 0:
    print(str(a*i))
    break
  else:
    i += 1

Solution (Python):
from fractions import gcd

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

def main():
    tmp = gcd(a,b)
    print(tmp*(a//tmp)*(b//tmp))
    return

if __name__ == "__main__":
    main()

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

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

Solution (Python):
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))
    return


main()

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


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


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


main()

Solution (Python):

A, B = [int(i) for i in input().split(" ")]
i = 1
while(True):

    if A*i % B ==0:
        print(A*i)
        break

    i += 1

Solution (Python):
def calc_gcd(a, b):
    r = a % b
    while (r != 0):
        a = b
        b = r
        r = a % b

    return b

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

if a < b:
    tmp = a
    a = b
    b = tmp

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

print(ans)

Solution (Python):
a, b = (int(i) for i in 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))

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

Solution (Python):
import fractions

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

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

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

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

Solution (Python):
A,B =map(int,input().split())
for i in range(1,B+1):
    if A * i % B ==0:
        print(A*i)
        break

Solution (Python):
import fractions

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

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

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

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

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

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

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

Solution (Python):
import operator
import functools

A, B = input().split()

A = int(A)
B = int(B)

value = []

count = 0

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

primeA = prime_factorize(A)

primeB = prime_factorize(B)


for i in range(len(primeA)):
    for j in range(len(primeB)):
        if primeA[i] == primeB[j]:
            value.append(primeA[i])
            primeA[i] = 1
            primeB[j] = 1
            break
        else:
            continue

value = value + primeA + primeB

result = functools.reduce(operator.mul, value)

print(result)

Solution (Python):
A, B = map(int, raw_input().split())

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

print A * B / gcd(A, B)

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

i = 1
while(True):
    if (a * i) % b == 0:
        ans = a * i
        break
    i += 1

print(ans)

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

i = 1
flag = True
while(flag):
    if (a * i) % b == 0:
        flag = False
        ans = a * i
        break
    i += 1

print(ans)

Solution (Python):
import math
a, b = map(int, input().split())

i = 1
flag = True
while(flag):
    if (a * i) % b == 0:
        flag = False
        ans = a * i
        break
    i += 1

print(ans)

Solution (Python):


import math
import sys
import fractions
a = list(map(int, input().split()))

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

Solution (Python):
A,B = (int(i) for i in input().split())

import fractions

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

print(lcm(A,B))

Solution (Python):
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))

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

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

import fractions 

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

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

Solution (Python):
A,B=map(int,input().split())
def gcd(a,b):
  a,b=max(a,b),min(a,b)
  if a==b:
    return a
  else:
    if a%b==0:
      return b
    else:
      return gcd(b,a%b)
g=gcd(A,B)
print(int(A*B/g))

Solution (Python):
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))

Solution (Python):
A,B = map(int,input().split())
a,b = A,B
while True:
    if a > b:
        b += B
    elif a < b:
        a += A
    if a == b:
        print(a)
        break