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:
def gcd(x, y):
    if x % y == 0:
        return y
    return gcd(y, x % y)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista

def NWD(A,B): 
    if B > A: 
        A, B = B, A 
    if B == 0: 
        return A
    else: 
        return NWD(A%B,B)

def party(): 
    A, B = wczytaj_liste()
    najwiekszy_dzielnik = NWD(A,B)
    odp = A*B//najwiekszy_dzielnik
    print(odp)

party()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True
#for i in range(n):

ans=0
a,b=LI()
import fractions
print(a*b//fractions.gcd(a,b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split(" "))
a1,b1 = a,b
if a < b:
    tmp = b
    b = a
    a = tmp

r = a%b
while(r!=0):
    a = b
    b = r
    r = a%b

print(int(a1*b1/b))

Submission status: Accepted

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

Submission status: Accepted

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

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

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:

x, y = input().split()
x = int(x)
y = int(y)
if x < y:
    a = y
    b = x
else:
    a = x
    b = y

while b:
    a, b = b, a % b

print(x * y // a)

Submission status: Accepted

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

a,b = map(int,input().split())
if b > a:
  t = a
  a = b
  b = t
print(lcm(a,b))

Submission status: Accepted

Solution code:
x,y = input().split()
x = int(x)
y = int(y)
if x < y:
  a = y
  b = x
else:
  a = x
  b = y
 
while b:
  a, b = b, a % b
 
print(x * y // a)

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

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
i = 1
  
if a < b:
  c = a
  a = b
  b = c

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

Submission status: Accepted

Solution code:
#coding:utf-8
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:
        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 as fr
A,B = map(int,input().split())
 
def lcd(x,y):
  return (x*y)//fr.gcd(x,y)
 
print(lcd(A,B))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
numberA = 0
numberB = 0
dataA = []
dataB = []
sosuA = []
sosuB = []
flagA = []
flagB = []
i = 1
boc = 0
while i <= A:
    dataA += [i]
    i += 1
i = 1
while i <= B:
    dataB += [i]
    i += 1
n = 1
while n <= A:
    if A == 1:
        sosuA += [n]
        numberA += 1
        break
    if A % n == 0:
        sosuA += [n]
        A = A / n
        numberA += 1
        if n == 1:
            n += 1
    else:
        n += 1
n = 1
while n <= B:
    if B == 1:
        sosuB += [n]
        numberB += 1
        break
    if B % n == 0:
        sosuB += [n]
        B = B / n
        numberB += 1
        if n == 1:
            n += 1
    else:
        n += 1
i = 0
n = 0
rase = 0
while i <= numberA - 1:
    if i != 0 and sosuA[i] == sosuA[i - 1]:
        kai = sosuA[i]
        flagA += [kai]
        i += 1
        n = 0
        rase = 0
        continue
    if sosuA[i] == sosuB[n]:
        kai = sosuA[i]
        flagA += [kai]
        n += 1
        rase = 1
        if n == numberB - 1 or numberB:
            i += 1
            n = 0
            rase = 0
            continue
        if i == numberA - 1 or numberA:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuA[i] != sosuB[n] and n == numberB - 1:
        kai = sosuA[i]
        flagA += [kai]
        if i == numberA - 1:
            break
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
rase = 0
while i <= numberB - 1:
    if i != 0 and sosuB[i] == sosuB[i - 1]:
        kai = sosuB[i]
        flagB += [kai]
        i += 1
        n = 0
        rase = 0
        continue
    if sosuB[i] == sosuA[n]:
        kai = sosuB[i]
        flagB += [kai]
        n += 1
        rase = 1
        if n == numberA or numberA - 1:
            i += 1
            n = 0
            rase = 0
        if i == numberB - 1 or numberB:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuB[i] != sosuA[n] and n == numberA - 1:
        kai = sosuB[i]
        flagB += [kai]
        if i == numberB - 1:
            break
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
tuika = []
if len(flagA) >= len(flagB):
    while i <= numberB - 1:
        if sosuB[i] == flagA[n]:
            n += 1
            i += 1
            if n == len(flagA):
                sai = len(sosuB) - i
                for m in range(sai):
                    tuika += [sosuB[i]]
                    i += 1
                break
        elif n == numberA - 1:
            kai = sosuB[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuB[i] < sosuA[n]:
            kai = sosuB[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagA += tuika
    ans = 1
    for i in flagA:
        ans = ans * i
    print(ans)
else:
    while i <= numberA - 1:
        if sosuA[i] == flagB[n]:
            n += 1
            i += 1
        if n == len(flagB):
                sai = len(sosuA) - i
                for m in range(sai):
                    tuika += [sosuA[i]]
                    i += 1
                break
        elif n == numberB - 1:
            kai = sosuA[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuA[i] < sosuB[n]:
            kai = sosuA[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagB += tuika
    ans = 1
    for i in flagB:
        ans = ans * i
    print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
numberA = 0
numberB = 0
dataA = []
dataB = []
sosuA = []
sosuB = []
flagA = []
flagB = []
i = 1
boc = 0
while i <= A:
    dataA += [i]
    i += 1
i = 1
while i <= B:
    dataB += [i]
    i += 1
n = 1
while n <= A:
    if A == 1:
        sosuA += [n]
        numberA += 1
        break
    if A % n == 0:
        sosuA += [n]
        A = A / n
        numberA += 1
        if n == 1:
            n += 1
    else:
        n += 1
n = 1
while n <= B:
    if B == 1:
        sosuB += [n]
        numberB += 1
        break
    if B % n == 0:
        sosuB += [n]
        B = B / n
        numberB += 1
        if n == 1:
            n += 1
    else:
        n += 1
i = 0
n = 0
rase = 0
while i <= numberA - 1:
    if i != 0 and sosuA[i] == sosuA[i - 1]:
        kai = sosuA[i]
        flagA += [kai]
        i += 1
        n = 0
        rase = 0
        continue
    if sosuA[i] == sosuB[n]:
        kai = sosuA[i]
        flagA += [kai]
        n += 1
        rase = 1
        if n == numberB - 1 or numberB:
            i += 1
            n = 0
            rase = 0
            continue
        if i == numberA - 1:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuA[i] != sosuB[n] and n == numberB - 1:
        kai = sosuA[i]
        flagA += [kai]
        if i == numberA - 1:
            break
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
rase = 0
while i <= numberB - 1:
    if i != 0 and sosuB[i] == sosuB[i - 1]:
        kai = sosuB[i]
        flagB += [kai]
        i += 1
        n = 0
        rase = 0
        continue
    if sosuB[i] == sosuA[n]:
        kai = sosuB[i]
        flagB += [kai]
        n += 1
        rase = 1
        if n == numberA or numberA - 1:
            i += 1
            n = 0
            rase = 0
        if i == numberB - 1 or numberB:
            break
    elif rase == 1:
        i += 1
        n = 0
        rase = 0
    elif sosuB[i] != sosuA[n] and n == numberA - 1:
        kai = sosuB[i]
        flagB += [kai]
        if i == numberB - 1:
            break
        i += 1
        n = 0
    else:
        n += 1
i = 0
n = 0
tuika = []
if len(flagA) >= len(flagB):
    while i <= numberB - 1:
        if sosuB[i] == flagA[n]:
            n += 1
            i += 1
            if n == len(flagA):
                sai = len(sosuB) - i
                for m in range(sai):
                    tuika += [sosuB[i]]
                    i += 1
                break
        elif n == numberA - 1:
            kai = sosuB[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuB[i] < sosuA[n]:
            kai = sosuB[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagA += tuika
    ans = 1
    for i in flagA:
        ans = ans * i
    print(ans)
else:
    while i <= numberA - 1:
        if sosuA[i] == flagB[n]:
            n += 1
            i += 1
        if n == len(flagB):
                sai = len(sosuA) - i
                for m in range(sai):
                    tuika += [sosuA[i]]
                    i += 1
                break
        elif n == numberB - 1:
            kai = sosuA[i]
            tuika += [kai]
            i += 1
            n = 0
        elif sosuA[i] < sosuB[n]:
            kai = sosuA[i]
            tuika += [kai]
            n = 0
            i += 1
        else:
            n += 1
    flagB += tuika
    ans = 1
    for i in flagB:
        ans = ans * i
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


def lcm(a: int, b: int) -> int:
    '''Compute least common multiple of a and b.
    Args:
        a: Int of number (greater than 0).
        b: Int of number (greater than 0).
    Returns:
        least common multiple.
    Landau notation: O(log n)
    See:
    https://gist.github.com/endolith/114336/eff2dc13535f139d0d6a2db68597fad2826b53c3
    https://docs.python.org/3/library/sys.html#sys.version_info
    '''

    from sys import version_info

    if version_info.major == 3 and version_info.minor >= 5:
        from math import gcd
    else:
        from fractions import gcd

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

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(x ,y):
    while y:
        x, y = y, x % y
    return x

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

Submission status: Accepted

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

Submission status: Accepted

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

multiples = []
for i in range(1, B + 1):
    multiples.append(A * i)

for i in multiples:
    if i % B == 0:
        print(i)
        exit()

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

Submission status: Accepted

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

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

aa = prime_factorize(a)
bb = prime_factorize(b)

if aa == []:
  print(b)
elif bb == []:
  print(a)
else:
  outList = []
  for _ in range(len(aa)):
    
    while len(bb) >= 1 and bb[0] < aa[0]:
      outList.append(bb[0])
      bb.pop(0)
    
    if len(bb) == 0:
      break
   
    if aa[0] == bb[0]:
      outList.append(aa[0])
      aa.pop(0)
      bb.pop(0)
    elif aa[0] < bb[0]:
      outList.append(aa[0])
      aa.pop(0)
      
    if len(bb) == 0:
      break
      
  out = 1
  for i in range(len(outList)):
    out *= outList[i]
  for i in range(len(aa)):
    out *= aa[i]
  for i in range(len(bb)):
    out *= bb[i]
  print(out)

Submission status: Accepted

Solution code:
str = list(map(int, input().split()))
a = str[0]
b = str[1]
i = 1
if a < b:
  big = b
  small = a
else:
  big = a
  small = b

while i != 0:
  i = big % small
  big = small
  small = i

print (int(a*b/big))

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())
p, q = a, b
r = p % q
while r > 0:
  p, q = q, r
  r = p % q
print(a // q * b)

Submission status: Accepted

Solution code:
raw = str(input()).split()
a = int(raw[0])
b = int(raw[1])

minVal, maxVal = min(a, b), max(a, b)

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

Submission status: Accepted

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

m=max(A,B)
n=min(A,B)
while m%n != 0:
    temp = n
    n = m%n
    m = temp


print(A*B // n)

Submission status: Accepted

Solution code:
s,t = list(map(int, input().split()))
a = max(s,t)
b = min(s,t)
#print(s,t)
while b != 0:
  p = a % b
  a = b
  b = p

k = s * t  // a

print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from fractions import gcd
a, b = map(int, input().split())
print(a * b // gcd(a, b))

Submission status: Accepted

Solution code:
A,B = list(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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    gcd = fractions.gcd(a, b)
    print(a*b//gcd)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x,y):
    tmp = x
    x = x if x >= y else y
    if tmp != x:
        y = tmp
    if y == 0:
        return x
    return gcd(x%y, y)

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

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

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

Submission status: Accepted

Solution code:
def gcd(a, b):
    if b == 0:
        return a
    else:
        c = a % b
        return gcd(b, c)
        
a, b = map(int, input().split())
if a < b:
    a, b = b, a

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

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
def gcd(a, b):
  if a < b:
    a, b = b, a
  else:
    pass
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)
  
print(a * b // gcd(a, b))

Submission status: Accepted

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


ab = list(map(int, input().split()))
a, b = ab[0], ab[1]
g = gcd(a, b)
print(a * b // g)

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())
a = A
b = B
while True:
    if a == b:
        break
    elif a < b:
        a += A
    else:
        b += B
        
print(a)

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:
#!/usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


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


def LF(): return list(map(float, input().split()))


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


mod = 1000000007
inf = float('INF')

# solve


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


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


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

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 = [int(i) for i in input().split()]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
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 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 = input().split()
a,b = int(a), int(b)
x = max(a,b)
y = min(a,b)
t = 0
if x % y == 0:
    t = y
else:
    while x % y != 0:
        z = x%y
        x = y
        y = z
    t = z

glm = a * b /t
print(round(glm))

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

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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


def main():
    a,b = mi()

    print(lcm(a, b))

    
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

# スペース区切りの整数の入力
x, y = map(int, input().split())
print(int((x * y) / gcd(x, y)))

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

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

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
def gcd(x, y):
  r = x % y
  while r > 0:
    x = y
    y = r
    r = x % y
  return y

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
# 約数列挙
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

A, B = map(int, input().split())
ptn = list(reversed(make_divisors(A * B)))

for i in range(0, len(ptn), 2):
    if ptn[i] % A == 0 and ptn[i] % B == 0:
        print(ptn[i])
        exit()
print(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:
def gcd(a,b):
  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:
from sys import stdin
import math

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

  return gcd(b, a % b)


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

A, B= [int(x) for x in stdin.readline().rstrip().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)

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

print(lcm(A, B))

Submission status: Accepted

Solution code:
def gcd(x0, y0):
    if x0<y0:
        tmp0 = x0
        x0 = y0
        y0 = tmp0
    if y0 == 0:
        return x0
    else:
        return gcd(y0, x0 % y0)

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())
if A > B: A, B = B, A;

d = 1
for i in range(1, A+1):
    if A % i == 0 and B % i == 0: d = i

ans = A // d * B
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    x,y = [int(x) for x in input().split()]
    if x < y:
        tmp = x
        x = y
        y = tmp
    a = x * y
    
    r = x % y;
    while(r!=0):
        x = y
        y = r
        r = x % y;
    
    print(int(a/y))

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
#!python3

def factor(n):
    ans = []
    i = 0
    while n & 1 == 0:
        n >>= 1
        i += 1

    if i > 0:
        ans.append((2, i))

    for i in range(3, int(n**.5) +1, 2):
        x, y = divmod(n, i)

        if y == 0:
            j = 1
            x1 = x
            while True:
                x1, y = divmod(x, i)
                if y == 0:
                    x = x1
                    j += 1
                else:
                    ans.append((i, j))
                    break
            n = x

    if n > 1:
        ans.append((n, 1))

    return ans

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

    fa = dict(factor(A))
    fb = dict(factor(B))


    a = A
    for k, v in fa.items():
        if k in fb:
            v2 = fb[k]
            if v < v2:
                a *= k ** (v2 - v)
            del fb[k]
    for k, v in fb.items():
        a *= k ** v

    print(a)

if __name__ == "__main__":
    resolve()

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

prod = a * b

while b != 0:
  a, b = b, a % b
  
print(prod // a)

Submission status: Accepted

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

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

Submission status: Accepted

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

for x in range(a, 10**10, a):
    if(x % a == 0 and x % b == 0):
        print(x)
        exit()

Submission status: Accepted

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