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:
import math
import numpy as np
a0,b0 = (int(i) for i in input().split())
a = a0
b = b0
if a<b:
  tmp = a
  a = b
  b = tmp
r = a%b
while r != 0:
  a = b
  b = r
  r = a%b
ans = a0*b0//b
print(ans)

Submission status: Accepted

Solution code:
import math

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

if A < B:
	ans = B
	while ans % A != 0:
		ans += B
	print(ans)
else:
	ans = A
	while ans % B != 0:
		ans += A
	print(ans)

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
b = a[0]
c = a[1]
def gcd(b,c):
    while c!=0:
        b,c=c,b%c
    return b

div = gcd(b,c)
ans = b*c//div
print(ans)

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

numbers = input().split(" ")
num1 = int(numbers[0])
num2 = int(numbers[1])
print(lcm(num1,num2))

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
if a[0] > a[1]:
  pass
else:
  b = a[0]
  c = a[1]
  a[0] = c
  a[1] = b

b = a[0]
c = a[1]

import fractions

g = fractions.gcd(b,c)

print(int((b * c) / g))

Submission status: Accepted

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

X = A * B

# greatest_common_divisor
if A < B:
    tmp = B
    B = A
    A = 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())
 
 #最大公約数
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
#print(gcd(a,b))

 #最小公倍数
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))

Submission status: Accepted

Solution code:
s=input().split()
a=int(s[0])
b=int(s[1])
for i in range(100000000000):
  if i!=0:
    if a*i%b==0:
      print(a*i)
      break
    if b*i%a==0:
      print(b*i)
      break

Submission status: Accepted

Solution code:
N,M = map(int,input().split())

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

g = gcd(N,M)
n=N/g
m=M/g

print(int(n*m*g))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def gcd(n, m):
    r = n % m
    if r == 0:
        return m
    else:
        return gcd(m, r)


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

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
i = 1
if A <= B:
  N = B
  while (N % A) != 0:
    i += 1
    N = B * i
else:
  N = A
  while (N % B) != 0:
    i += 1
    N = A * i
print(N)

Submission status: Accepted

Solution code:
num_list = [int(i) for i in input().split()]

result = 0

if num_list[0] < num_list[1]:
    A = num_list[0]
    B = num_list[1]
else:
    A = num_list[1]
    B = num_list[0]

while True:
    amari = A % B
    if amari == 0:
        break
    A = B
    B = amari

#最大公約数 B

#最小公倍数
result =  num_list[0] * num_list[1] // B

print(result)

Submission status: Accepted

Solution code:
def gcd (a,b):
    if b ==0:
        return a
    else:
        return gcd(b, a%b)
a,b = [int(i) for i in input().split()]
val = gcd(a,b)
prod = a*b
ans = int(prod/val)
print(ans)

Submission status: Accepted

Solution code:
a,b = [int(i) for i in input().split()]
a_ = []
b_ = []
for i in range(1,a+1):
    if a%i == 0:
        a_.append(i)

for i in range(1,b+1):
    if b%i == 0:
        b_.append(i)

for i in a_[::-1]:
    if i in b_:
        m = i
        break


print(a*b//m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def LCM(x, y):
    set1 = set(range(x, x*y+1, x))
    set2 = set(range(y, x*y+1, y))
    set3 = set1&set2
    return min(set3)
a, b = map(int, input().split())
print(LCM(a, b))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import fractions
def answer(A, B):
  return round(A * B / fractions.gcd(A, B))

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
#greatest commmon divisor(gdc)を定義する
def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b
#least common multiple (lcm)を定義する
def lcm(a,b):
    return (a*b)// gcd(a, b)

print(lcm(a,b))

Submission status: Accepted

Solution code:
import fractions

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

a = kazu[0]
b = kazu[1]

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

print(lcm(a, b))

Submission status: Accepted

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

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

lcm = A * B // fractions.gcd(A,B)

print(lcm)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
#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)
i=0
#N=int(input())
A, B=input().split()
A=int(A)
B=int(B)
print(lcm(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

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

print(int(result))

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:
H = list(map(int, input().split()))
A = H[0]
B = H[1]
#print(A)
#print(B)
for i in range(1,B+1):
    #print("A")
    if (A*i % B == 0):
        #print("B")
        print(A*i)
        break

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 math

def computeGCD(x, y):
    if x > y:
        small = y
    else:
        small = x
    for i in range(1, small+1):
        if((x % i == 0) and (y % i == 0)):
            gcd = i
    return gcd
A, B = map(int, input().split())

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

Submission status: Accepted

Solution code:
if __name__=='__main__':
    a,b=map(int,input().split())
    A=a
    B=b
    while b!=0:
        a,b=b,a%b
    ans=a*(A//a)*(B//a)
    print(ans)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
#A>B
if A<B:
  a,b=B,A
else:
  a,b=A,B
for s in range(int(math.sqrt(b))+1):
  X=abs(a-b)
  if a>X:
    if b>X:
      a,b=b,X
    else:
      a=X
  a,b=b,a%b
  if b==0:
    break
print(A*B//a)

Submission status: Accepted

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

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

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

print(lcm(a,b))

Submission status: Accepted

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

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

r = a % b
while not r == 0:
  a = b
  b = r
  r = a % b

print(int(x / 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())
ans = lcm(A,B)
print(ans)

Submission status: Accepted

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

k = B
while True:
    if k % A ==0:
        ans = k
        break
    else:
        k += B

print(ans)

Submission status: Accepted

Solution code:
import sys
from fractions import gcd

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

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

main()

Submission status: Accepted

Solution code:
import math

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:
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:
import sys
import math
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd

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

Submission status: Accepted

Solution code:
def gcd(A,B): 
    if A == 0: 
        return B 
    return gcd(B % A, A) 
  
def lcm(A,B): 
    return (A*B) / gcd(A,B)

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

Submission status: Accepted

Solution code:
#LCMを求めれば良い
a, b = map(int, input().split())
s, t = max(a, b), min(a, b)
c = s%t
while (c != 0):
    s = t
    t = c
    c = s%t

ans = a * b//t
print(ans)

Submission status: Accepted

Solution code:
from fractions import gcd
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


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


if __name__ == "__main__":
    main()

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

Submission status: Accepted

Solution code:
import fractions

str = input().split(" ")

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

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

  if a % b == 0:
    return b
  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

def s(a, b):
    y = a*b / fractions.gcd(a, b)
    return int(y)
  
a = [int(i) for i in input().split()]

x = s(a[0],a[1])
print(x)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100001)

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

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def inputIntList():
    return [int(s) for s in input().split()]


def inputInt():
    return int(input())


def main():
    A, B = inputIntList()
    ans = 0
    step = max(A, B)
    another = min(A, B)
    for i in range(step, A * B+1, step):
        if i % another == 0:
            ans = i
            break
    return ans


if __name__ == "__main__":
    print(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:
from fractions import gcd

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

Submission status: Accepted

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

Submission status: Accepted

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


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


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


def main():
    a, b = map(int, input().split())
    res = solve(a, b)
    print(res)


def test():
    assert solve(2, 3) == 6
    assert solve(123, 456) == 18696
    assert solve(10000, 99999) == 999990000


if __name__ == "__main__":
    test()
    main()

Submission status: Accepted

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

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

min_ = min([a,b])

ret = a * b

for i in reversed(range(1,min_+1)):
  if a % i == 0 and b % i == 0:
    ret = int(a * b / i)
    break

print(ret)

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:
def lcm(x, y):
    a,b = x,y
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    
    return int(x * y / b)

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
A,B= input().split() 
A=int(A)
B=int(B)
seki=1
#print(A,B,seki)
if B>A:
  C=B
  B=A
  A=C
for i in range(2,A+1):
  while 1:
    wareru=0
    if round(int(A/i)*i,0)==A:
      wareru=1
      A/=i
    if round(int(B/i)*i,0)==B:
      wareru=1
      B/=i
    if wareru==0:
      break
    else:
      seki*=i
print(round(seki))

Submission status: Accepted

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

Submission status: Accepted

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

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

c = a * b

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

d = gcd(a, b)

print(int (c / d))

Submission status: Accepted

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

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
def lcm(x, y):
    return (x * y) // gcd(x, y)
 
d = [int(i) for i in input().split()]
 
print(lcm(d[0],d[1]))

Submission status: Accepted

Solution code:
import fractions
a,b=map(int, input().split())
f=fractions.gcd(a,b)
f2=a*b//f
print("{}".format(f2))

Submission status: Accepted

Solution code:
A, B = [int(x) for x 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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math as mt
a,b=map(int,input().split())
tem=max(a,b)
c=1
if a==b:
    print(a)
elif min(a,b)==1:
    print(max(a,b))
elif a%b==0 or b%a==0:
    print(max(a,b))
else:
        
    while 1:
        c+=1
        if (tem*c)%a==0 and (tem*c)%b==0:
            print(tem*c)
            break

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


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

print(lcm(a, b))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

num = input().split(' ')
a = int(num[0])
b = int(num[1])
print(lcm(a, b))

Submission status: Accepted

Solution code:
def euclidean(a,b):
    while True:
      r=a%b
      if r==0:
         return b
      a,b=b,r

a,b=map(int,input().split())
print(a*b//euclidean(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(x, y):
    return (x * y) // gcd(x, y)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd (a,b): 
  return b if a == 0 else gcd (b%a , a) 
num = [int (x) for x in input().split(" ")]
print (int(num[0]*num[1]/gcd(num[0],num[1])))

Submission status: Accepted

Solution code:
def q3(a,b):
  x = a*b
  if(a<b):
    tmp = a
    a=b
    b=tmp
  r=a%b
  while(not(r==0)):
    a=b
    b=r
    r=a%b
  return int(x/b)


ans = input().split()
a = int(ans[0])
b = int(ans[1])
print(q3(a,b))

Submission status: Accepted

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

res = a
while res % b != 0:
  res += a

print(res)

Submission status: Accepted

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


def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n
def lcm(x, y):
    return (x * y) // gcd(x, y)

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


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

Submission status: Accepted

Solution code:
import fractions
x,y = map(int,input().split())
ans = (x*y)/(fractions.gcd(x, y))
print(round(ans))

Submission status: Accepted

Solution code:
A, B = 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(int(A), int(B)))

Submission status: Accepted

Solution code:
def compute_gcd(x, y):
   while(y):
       x, y = y, x % y
   return x
# This function computes LCM
def compute_lcm(x, y):
   lcm = (x*y)//compute_gcd(x,y)
   return lcm
A, B = [int(i) for i in input().split()]
print(compute_lcm(A, B))

Submission status: Accepted

Solution code:
import fractions

a, b = map(int, (input().split()))
#lcm = least common multiple
    
print(a*b//fractions.gcd(a, b))

Submission status: Accepted

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

x, y = map(int, input().split())
hcf = gcd(x, y)
lcm = (x * y) / hcf
print(int(lcm))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
a,b = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

from fractions import gcd
def lcm_base(a, b):
	return (a * b) // gcd(a, b)

print( lcm_base(a, b) )

Submission status: Accepted

Solution code:
a,b = map(int, input().split(' '))
if a > b:
    r = a % b
    b_ = b
    while r != 0:
        temp = b % r
        b = r
        r = temp
    print(b_ * a // b)
elif a < b:
    r = b % a
    a_ = a
    while r != 0:
        temp = a % r
        a = r
        r = temp
    print(a_ * b // a)
else:
    print(b)

Submission status: Accepted

Solution code:
def g(x, y):
	while y > 0:
		x, y = y, x%y
	return x
def l(x, y):
	return x // g(x, y) * y

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


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

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

print(r)

Submission status: Accepted

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

def lcm(a, b):
    return (a * b) // gcd(a, b)
	
answer = lcm(A, B)
print(answer)

Submission status: Accepted

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

minV = min(A, B)
maxV = max(A, B)

if maxV % minV == 0:
  print(maxV)
  exit()

if maxV == minV + 1:
  print(maxV * minV)
  exit()

v = maxV * 2

for i in range(2, minV + 1):
  if v % minV != 0:
    v += maxV
    continue
  print(v)
  exit()

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

str = input()
astr, bstr = str.split(" ")
a = int(astr)
b = int(bstr)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

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

for i in range(b):
    now_num = a * (i + 1)
    if now_num % b == 0:
        ans = now_num
        break
    if i + 1 == b:
        ans = a * b

print(ans)

Submission status: Accepted

Solution code:
import fractions

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

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

print(lcm(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

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())
C, D = A, B
while D:
  C, D = D, C % D
print(A * B // C)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(lcm(a, b))
# 12

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(p,q):
    if p<q:
        p,q = q,p
    r = p
    p = q
    q = r%q
    if q!=0:
        return GCD(p,q)
    else:
        return p
gcd = GCD(A,B)
ans = (A*B)//gcd
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
print(a*b//gcd(a,b))

Submission status: Accepted

Solution code:
import fractions

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

people = input().split(" ")
pa = int(people[0])
pb = int(people[1])

print(cookie(pa,pb))

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:
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:
# 最大公約数
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

# 最小公倍数
def lcm(a, b):
    return a * b / gcd(a, b)

# 1行目の入力を空白で分割された文字列として扱う
A, B = map(int, input().split())

# 答えの準備
res = int(lcm(A, B))

# 答えの出力
print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# B - Strings with the Same Length
import sys
import os

def getGCD(A, B):
  a, b = A, B
  if B > A:
    a, b = B, A
  r = a%b
  while r != 0:
    a = b
    b = r
    r = a%b
  return b

def problem148C(A, B):
  gcd = getGCD(A, B)
  print(int(A*B/gcd))

if __name__ == "__main__":
  A, B = list(map(int, input().split()))
  problem148C(A, B)

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


def gcd(a, b):
  x = max(a, b)
  y = min(a, b)
  while x%y != 0:
    z = x%y
    x = y
    y = z
  return y

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

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 lcm(a,b):
  m=max(a,b)
  n=min(a,b)
  kk=0
  for j in range(n,a*b+1,n):
 

    if j%a==0 and j%b==0:
      kk=j
      break
  return kk
a,b=map(int,input().split())
c=lcm(a,b)
print(c)

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())
# ユークリッドの互除法を求める．共通因数を求める．
big = max(A,B)
small = min(A,B)

amari = None
while not amari==0:
    shou = int(big/small)
    amari = big % small 
    if amari == 0:
        not_commonA = A/small
        not_commonB = B/small
    else:
        big = small
        small = amari

print(int(not_commonA * not_commonB * small))

Submission status: Accepted

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

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

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

ANS=A*B/gcd

print(int(ANS))

Submission status: Accepted

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

for i in range(1,100000):
  if (i*a)%b == 0:
    break
      
print(i*a)

Submission status: Accepted

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

def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
print(int(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:
ab = sorted(input().split())
a = int(ab[0])
a_ = a
b = int(ab[1])
b_ = b
c = 1
while c > 0:
    c = a % b
    a = b
    b = c
print(int(a_ * b_ / a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
l = input().split()
a = int(l[0])
b = int(l[1])

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

Submission status: Accepted

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

x = a * b;

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

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

Submission status: Accepted

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

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
import math
import fractions

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

def bitlist(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

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

n,m=list(map(int, input().split()))
print(n*m//fractions.gcd(n,m))

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

Submission status: Accepted

Solution code:
from fractions import gcd

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
def lcm(a, b):
    return abs(a*b) // fractions.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):
    ma = max(x, y)
    mi = min(x, y)
    while 0 != ma % mi:
        tmp = ma % mi
        ma, mi = mi, tmp
    return mi

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

print(lcm(a,b))