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 fractions

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

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

print(ans)

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


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

if __name__ == '__main__':
  a, b = map(int, input().split())
  print(lcm(a,b))

Submission status: Accepted

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

Submission status: Accepted

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


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


print(lcm(a,b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
 
def devide_ok(x, y):
  if y / x == y // x:
    return True
  else:
    return False
  
for i in range(1, b + 1):
  if a * i >= b and devide_ok(b, a * i):
    print(a * i)
    break

Submission status: Accepted

Solution code:
import math
import random
from operator import itemgetter
import re
import sys
from itertools import accumulate
from collections import defaultdict
from collections import deque
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
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
A, B = map(int, open(0).read().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(A, B))

Submission status: Accepted

Solution code:
import numpy as np

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

Submission status: Accepted

Solution code:
import fractions

x, y = map(int, input().split())


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


print(lcm(x, y))

Submission status: Accepted

Solution code:
import fractions

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

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

ans = lcm(a, b)

print(ans)

Submission status: Accepted

Solution code:
from fractions import gcd

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

print(lcm(a, b))

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

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

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

Submission status: Accepted

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

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

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

print(ans)

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())
temp = b
hoge = a
if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b
print(hoge*temp//b)

Submission status: Accepted

Solution code:
import fractions

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

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


print(myans)

Submission status: Accepted

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

Submission status: Accepted

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

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)

res = lcm(A, B)

print(res)

Submission status: Accepted

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

print(ans)

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

x,y = map(int,input().split())

print((x * y) // fractions.gcd(x, y))

Submission status: Accepted

Solution code:
def gcd(x,y):
    if x<y:
        x,y=y,x
    if y==0:
        return x
    return gcd(y,x%y)
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())
gcd=fractions.gcd(a, b)
print(int(a*b/gcd))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import datetime
import itertools
import sys
import copy

# 入力
#N = int(input())
#S = str(input())
#N, A, B = map(int, input().split())
#N = int(input())
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:
import fractions


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


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

Submission status: Accepted

Solution code:
import fractions 

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

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

Submission status: Accepted

Solution code:
from sys import stdin
f_i = stdin

A, B = map(int, f_i.readline().split())

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

G = gcd(A, B)
L = (A // G) * (B // G) * G
print(L)

Submission status: Accepted

Solution code:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) 
    
s,t = map(int,input().split())
d = s * t // gcd(s, t)
print(d)

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

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b = INTM()
    c =min(a,b)
    d=max(a,b)
    if d%c ==0:
        print(int(d))
    else:
        while d%c!=0:
            e = d%c
            d = c
            c = e
#            print(e)
        print(int(a*b/e))
if __name__ == '__main__':
    do()

Submission status: Accepted

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

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

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

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

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

print(lcm(A[0], A[1]))
# 12

Submission status: Accepted

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



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

Submission status: Accepted

Solution code:

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

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

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


    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
m,n=map(int,input().split())
x=max(m,n)
y=min(m,n)
if x%y==0:
    a=y
else:
    while x%y!=0:
        a=x%y
        x=y
        y=a
print(int(m*n/a))

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

a = prime_factorize(A)
b = prime_factorize(B)

common = []
only_a = []
for i in a:
  if i in b:
    common.append(i)
    b.remove(i)
  else:
    only_a.append(i)

p = 1
for x in common + only_a + b:
  p *= x
print(p)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(ans)

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

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

Submission status: Accepted

Solution code:
import fractions

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

Str = input().split(" ")
Num1 = int(Str[0])
Num2 = int(Str[1])

print(lcm(Num1,Num2))

Submission status: Accepted

Solution code:
import sys
from fractions import gcd

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)


def main():
    A, B = MAP()
    
    lcm = lambda x, y: (x * y) // gcd(x, y)
    print(lcm(A, B))


if __name__ == '__main__':
    main()

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 = (int(x) for x in 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

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

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


a,b=acinput()

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

Submission status: Accepted

Solution code:
A ,B= map(int,input().split())
#最大公約数、最小公倍数
import fractions
f=fractions.gcd(A,B)#最大公約数
f2=A*B//f           #最小公倍数
print(f2)

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())
x=max(a,b)
y=min(a,b)

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

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

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

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

# print('input >>')
A, B = map(int,(input().split()))

# print('-----output-----')
print(lcm(A, B))

Submission status: Accepted

Solution code:
# ABC148 C
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
from fractions import gcd
def lcm(x, y):
    """
    xとyの最小公倍数を求める。

    Parameters
    ----------
    x,y : int
        自然数

    Returns
    -------
        最小公倍数：int

    """
    return (x * y) // gcd(x, y)

a,b=nm()
print(lcm(a,b))

Submission status: Accepted

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

if A < B:
    tmp = A
    A = B
    B = tmp

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

print(ans * A)

Submission status: Accepted

Solution code:
AB = list(map(int, input().split()))
AB.sort()
i = 2 
j = 1 
while 1:
        if AB[0] * i == AB[1] * j:
                print(AB[0] * i)
                break
        if AB[0] * i > AB[1] * j:
                j += 1
        else:
                i += 1

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:
#!/usr/bin/env python3
import sys


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

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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

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

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

print(int(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:
import fractions

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

gab = fractions.gcd(a, b)

ans = (a // gab) * (b // gab) * gab

print(ans)

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:
a, b = map(int, input().split())
if a<b: a,b=b,a
c = a*b
while b: a, b = b, a%b
print(c//a)

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:
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect

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

    ans = lcm(A, B)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

x = A*B

if A < B:
    t =A
    A = B
    B = t

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

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

Submission status: Accepted

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

for i in range(s, a*b+1, s):
    if i % a  == 0 and  i % b == 0:
        break

print(i)

Submission status: Accepted

Solution code:
# coding: utf-8
a, b = map(int, input().split())

tmp_a = a
tmp_b = b

while tmp_a != tmp_b:
    if tmp_a < tmp_b:
        tmp_a += a
    else:
        tmp_b += b
print(tmp_a)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd


def least_common_multiple(iter):
    '''
    最小公倍数を返す
    '''
    lcm = lambda x, y: x*y//gcd(x, y)
    return reduce(lcm, iter)


AB = map(int, input().split())
print(least_common_multiple(AB))

Submission status: Accepted

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

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

print(A * B // 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


def main():
    A, B = map(int, input().split())
    AB = gcd(A, B)
    ans = (A * B) // AB
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys; readline = sys.stdin.readline
from collections import deque


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

def f(a, b):
    if a < b:
        a, b = b, a

    while True:
        if a % b == 0:
            break
        r = a % b
        a, b = b, r
    
    return b

c = f(A, B)

print(A * B // c)

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 sys
input = sys.stdin.readline

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)

print(lcm(a, b))

Submission status: Accepted

Solution code:
import fractions


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


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

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

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

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

Submission status: Accepted

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

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

z = lcm(a,b)
print(z)

Submission status: Accepted

Solution code:
#coding:utf-8

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())
x = max(a,b)
y = min(a,b)
while y!=0:
    x,y = y,x%y
print((a*b)//x)

Submission status: Accepted

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

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

Submission status: Accepted

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


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

print(A * B // g)

Submission status: Accepted

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

import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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:
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())
gcd = computeGCD(a,b)
print((a*b)//gcd)

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):
    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())
x = (A*B) // fractions.gcd(A, B)

print(x)

Submission status: Accepted

Solution code:
import fractions

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

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

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

Submission status: Accepted

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

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

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

print(lcm(a, b))

Submission status: Accepted

Solution code:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


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

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

    
    

        


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
Adiv=[]
Bdiv=[]
Co=[]
for i in range(1,A+1):
  if A%i==0:
    Adiv+=[i]
for i in range(1,B+1):
  if B%i==0:
    Bdiv+=[i]
for i in Adiv:
  if i in Bdiv:
    Co+=[i]
M=max(Co)
print(int(A*B/M))

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

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

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

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

print(lcm(A,B))

Submission status: Accepted

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

minArg = min(a, b)
maxArg = max(a, b)
i = 2

while True:
    tmp = minArg * i
    if tmp%maxArg == 0:
        print(tmp)
        exit()
    else:
        i += 1

Submission status: Accepted

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

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(' ')]
gcd_ = gcd(A, B)
print(int(A*B/gcd_))

Submission status: Accepted

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

def gcd(x,y):
  if y == 0:
    return x
  else:
    return gcd(y,x % y)
ans = A * B / gcd(A,B)
print(int(ans))

Submission status: Accepted

Solution code:
# import numpy as np
import sys
input = sys.stdin.readline

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)

res = lcm(A,B)

print(res)

Submission status: Accepted

Solution code:
import fractions
def main():
    a,b = map(int ,input().split())
    ans=a*b//fractions.gcd(a,b)
    print(ans)
if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
# %%
a,b = map(int,input().split())
#a>b
if a > b :
    c = a
    d = b
else:
    c = b
    d = a

def gcd(a,b):
    while b!=0:
        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:
import sys
import fractions
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

a, b = map(int, read().split())
f= fractions.gcd(a,b)
f_ = a *b // f
 
print(f_)

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:
#!/usr/bin/env python3
import sys
import fractions


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
a,b = map(int, input().split())

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

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

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 = list(map(lambda x: int(x), input().split(" ")))
A = a_b[0]
B = a_b[1]

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=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:
#!/usr/bin/env python3
import fractions
def main():
    A,B = map(int, input().split())
    print((A*B) // fractions.gcd(A,B))


if __name__ == "__main__":
    main()

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

print(int(c))

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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


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

Submission status: Accepted

Solution code:
x, y = input().split(' ')
x = int(x)
y = int(y)

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


# Function to return LCM of two numbers
def lcm(a, b):
    return (a * b) / gcd(a, b)

print(int(lcm(x, y)))