AtCoder Beginner Contest 148 - Snack

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-----
2 3

-----Sample Output-----
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.

Difficulty: EASY

Starter code:

Solutions:
from math import gcd
(a, b) = map(int, input().split())
lcm = a * b / gcd(a, b)
print(int(lcm))


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


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


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


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


import math

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

def lcm(x, y):
	return x * y // math.gcd(x, y)
[a, b] = L()
print(lcm(a, b))


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


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


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


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


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


import math
(num1, num2) = map(int, input().split())
print(num1 * num2 // math.gcd(num1, num2))


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


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


(a, b) = map(int, input().split())
c = a * b
while b:
	(a, b) = (b, a % b)
print(c // a)


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


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


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


(a, b) = map(int, input().split())
i = 1
while a * i % b != 0:
	i += 1
print(a * i)


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


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


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


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


def main():
	from math import gcd
	(A, B) = list(map(int, input().split()))
	print(A * B // gcd(A, B))

def __starting_point():
	main()
__starting_point()


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


import math
import collections
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))
(a, b) = mi()
print(a * b // math.gcd(a, b))


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


(A, B) = map(int, input().split())
s = A
while s % B != 0:
	s += A
print(s)


(A, B) = map(int, input().split())
x = A * B
if A < B:
	(A, B) = (B, A)
p = A % B
while p != 0:
	(A, B) = (B, p)
	p = A % B
print(round(x / B))


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


(a, b) = [int(i) for i in input().split()]
from fractions import gcd
print(a * b // gcd(a, b))


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

def lcm(x, y):
	return x * y // math.gcd(x, y)
print(lcm(A, B))


(a, b) = map(int, input().split())
c = a
d = b
for i in range(a * b):
	if c < d:
		c = c + a
	elif d < c:
		d = d + b
	else:
		break
print(c)


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
(a, b) = map(int, input().split())
tmp = gcd(a, b)
print(int(a * b / tmp))


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


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


import math
[a, b] = [int(i) for i in input().split()]
print(a * b // math.gcd(a, b))


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


a = list(map(int, input().split()))
b = a[0]
while b % a[1] != 0:
	b += a[0]
print(b)


(a, b) = map(int, input().split())
for i in range(1, 10 ** 5):
	c = a * i
	if c % b == 0:
		print(c)
		return


import math
[A, B] = [int(i) for i in input().split()]
ans = A * B / math.gcd(A, B)
print(int(ans))


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


import numpy as np
(A, B) = list(map(int, input().split()))
print(np.lcm(A, B))


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


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


(A, B) = list(map(int, input().split()))
i = 1
while True:
	n = A * i
	if n % B == 0:
		print(n)
		break
	i += 1


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

def get_GCD(x, y):
	if x > y:
		(x, y) = (y, x)
	y_ = y
	while True:
		if y % x == 0:
			break
		else:
			y += y_
	return y
print(get_GCD(a, b))


from fractions import gcd
(a, s) = map(int, input().split())
print(a * s // gcd(a, s))


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


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


import math
(x, y) = map(int, input().split())
print(x * y // math.gcd(x, y))


import sys
from itertools import chain

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

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

def solve(A: int, B: int):
	answer = lcm(A, B)
	return answer

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

def __starting_point():
	main()
__starting_point()


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


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

def gcd(x, y):
	if y == 0:
		return x
	if x >= y:
		return gcd(y, x % y)
	if x < y:
		return gcd(x, y % x)
g = gcd(A, B)
print(A * B // g)


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


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


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


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


import math
(a, b) = list(map(int, input().split()))
x = math.gcd(a, b)
y = a * b
ans = y // x
print(ans)


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


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


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

def gcd(x, y):
	if x % y == 0:
		return y
	else:
		return gcd(y, x % y)
GCD = gcd(A, B)
a = A // GCD
b = B // GCD
print(a * b * GCD)


from math import gcd
(a, b) = map(int, input().split())
val = gcd(a, b)
print(a * b // val)


from math import gcd
(A, B) = list(map(int, input().split()))
print(A * B // gcd(A, B))


def gcc(a, b):
	if b == 0:
		return a
	return gcc(b, a % b)
(A, B) = list(map(int, input().split()))
if A < B:
	(A, B) = (B, A)
print(A * B // gcc(A, B))


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

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)
print(a * b // gcd(a, b))


import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
input = sys.stdin.readline

def RD():
	return input().rstrip()

def F():
	return float(input().rstrip())

def I():
	return int(input().rstrip())

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

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

def TI():
	return tuple(map(int, input().split()))

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

def Init(H, W, num):
	return [[num for i in range(W)] for j in range(H)]

def main():
	(A, B) = MI()
	print(A * B // math.gcd(A, B))

def __starting_point():
	main()
__starting_point()


from math import gcd
(A, B) = map(int, input().split())
if A < B:
	(A, B) = (B, A)
print(A * B // gcd(A, B))


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


(A, B) = map(int, input().split())
r = A * B
while B:
	(A, B) = (B, A % B)
print(r // A)


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


from math import gcd

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


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

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

def abc(a, b):
	return a * b // gcd(a, b)
print(abc(A, B))


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

def compute_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def compute_lcm(x, y):
	lcm = x * y // compute_gcd(x, y)
	return lcm
num1 = 54
num2 = 24
print(compute_lcm(a, b))


import math
(A, B) = [int(n) for n in input().split()]
print(int(A * B / math.gcd(A, B)))


from math import *
(n, m) = map(int, input().split())
g = gcd(n, m)
print(n * m // g)


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


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


(A, B) = map(int, input().split())
i = 1
while A * i % B != 0:
	i += 1
print(A * i)


import fractions
(n, m) = [int(s) for s in input().split()]
print(n * m // fractions.gcd(n, m))


(A, B) = map(int, input().split())
if A > B:
	a = A
	b = B
else:
	a = B
	b = A
r = 1
while r > 0:
	r = a % b
	a = b
	b = r
print(A * B // a)


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


import math
(A, B) = [int(s) for s in input().split()]
print(A * B // math.gcd(A, B))


import math
(m, n) = map(int, input().split())
print(m * n // math.gcd(m, n))


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


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


(A, B) = map(int, input().split())
x = A
y = B
while y > 0:
	(x, y) = (y, x % y)
print(A // x * B)


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


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


import math as mp
(a, b) = map(int, input().split())
print(a * b // mp.gcd(a, b))


(A, B) = map(int, input().split())
import math
a = math.gcd(A, B)
ans = A * B // a
print(ans)


(a, b) = map(int, input().split())
c = 1
while a * c % b != 0:
	c += 1
print(a * c)


(A, B) = map(int, input().split())
from math import gcd
ans = A * B // gcd(A, B)
print(ans)


from math import gcd

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


def gcd(m, n):
	if m < n:
		(m, n) = (n, m)
	while True:
		r = m % n
		if r == 0:
			return n
		else:
			(m, n) = (n, r)

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


(A, B) = map(int, input().split())
C = A
D = B
for i in range(B):
	K = C % D
	if K == 0:
		break
	else:
		C = D
		D = K
ans = A * B // D
print(ans)