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 sys

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

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

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

def main():
    ans = lcm(a, b)
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

def lcm(x, y):
    return (x * y) // 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())
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, raw_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:
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,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:
import queue
import math
import copy
"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
(N,M) = (int(i) for i in input().split(" "))
a,b = min(N,M),max(N,M)

while b%a != 0:
	a,b = b%a,a
print(N*M//a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(lcm(a,b))

Submission status: Accepted

Solution code:
import sys
from fractions import gcd


def main():
    # input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

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


def main():
    a, b = map(int, input().split())
    res = (a * b) // fractions.gcd(a, b)
    return res


print(main())

Submission status: Accepted

Solution code:
def gcd(x, y):
    if x < y:
        a, b = x, y
    else:
        a, b = y, x

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

    return b


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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    def gcd(a,b):
        if b>a:
            a,b=b,a
        while b:
            a,b=b, a%b
        return a
    a,b=list(map(int,input().split()))
    print(a*b//gcd(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:
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 sys
input = sys.stdin.readline

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


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

print(lcm(a, b))

Submission status: Accepted

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

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

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

# print(gcd(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!=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:
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:
from sys import stdin
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a,b = [int(x) for x in stdin.readline().rstrip().split()]

print(lcm(a,b))

Submission status: Accepted

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

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

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

print(C)

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:

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

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

#最小公倍数
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 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:
# N= int(input())
# N, K = [int(_) for _ in input().split()]
def gcd(a, b):
    if b > a:
        a, b = b, a
    c = a % b
    return b if c == 0 else gcd(b, c)


a, b = [int(_) for _ in input().split()]
d = gcd(a, b)
print(a // d * b // d * d)

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)

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

print(lcm(a, b))

Submission status: Accepted

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

mx = max(a, b)

gcd = 1
for i in range(1, mx + 1):
    if a % i == 0 and b % i == 0:
        gcd = i

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

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


A, B = (int(i) for i in input().split())  
#a = [int(i) for i in input().split()] 
#e = [[int(i) for i in input().split()] for i in range(n)] 

print(lcm(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(lcm(A, B))

Submission status: Accepted

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

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

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

def gcd(a, b):
    # 大きい方を被除数、小さい方を除数とする
    dividend = max(a, b)
    divider = min(a, b)

    if divider == 0:
        return dividend

    # 最大公約数を見つけるまで繰り返す
    while dividend % divider != 0:
        # 除算を行い、その除数を次回の被除数、剰余を次回の除数として処理を繰り返す
        r = dividend % divider
        dividend = divider
        divider = r

    # 一方がもう一方を割り切れた時点で、その除数を最大公約数とみなせる
    return divider

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


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

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


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from fractions import gcd

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
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:
def gcd(n,m):
    while n:
        m,n = [n,m%n]
    return m

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
import numpy as np
A, B = [int(x) for x in 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:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m,n%m)
a,b = LI()
g = gcd(a,b)
ans = a*b//g
print(ans)

Submission status: Accepted

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


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


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]


import fractions
def main():
    A, B = read_values()
    print(int(A * B / fractions.gcd(A, B)))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(lcm(A,B))

Submission status: Accepted

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

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

Submission status: Accepted

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



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

Submission status: Accepted

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

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 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:
A,B = map(int,input().split())
def dcg(a,b):
	if a > b:
		a,b = b,a
	while b % a > 0:
		temp = b % a
		b = a
		a = temp
	return a

print(A*B // dcg(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 fractions
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.1415926535897932
IS=float('inf')
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
def niten(a,b): return abs(a-b) if a>=0 and b>=0 else  a+abs(b) if a>=0 else abs(a)+b if b>=0 else abs(abs(a)-abs(b))
def fib(n): return [(seq.append(seq[i-2] + seq[i-1]), seq[i-2])[1] for seq in [[0, 1]] for i in range(2, n)]
# fractions.gcd(x,y)
def lcm(a,b): return a*b//fractions.gcd(a,b)
def eucl(x1,y1,x2,y2): return ((x1-x2)**2+(y1-y2)**2)**0.5
def choco(xa,ya,xb,yb,xc,yc,xd,yd): return 1 if abs((yb-ya)*(yd-yc)+(xb-xa)*(xd-xc))<1.e-10 else 0
def eof(t): print(t); exit()


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:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

import fractions

A,B = two_int()

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

Submission status: Accepted

Solution code:
def gcd(a,b):
    if a%b ==0 :
        return b
    else:
        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())

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

Submission status: Accepted

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

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

ans = (A * B) // mygcd(A, B)

print(ans)

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

ans = (A*B) //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:
import sys
from fractions import *

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A, B = [int(x) for x in input().strip().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 sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from fractions import gcd

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

g = gcd(a, b)

print(a * b // g)

Submission status: Accepted

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

import fractions


def main():
    A, B = [int(x) for x in input().split()]
    print((A * B) // fractions.gcd(A, B))

    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

A, B = MI()

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

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

Submission status: Accepted

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

def main():
    a,b = map(int,input().split())
    g = gcd(max(a,b),min(a,b))
    lcm = a*b//g

    print(lcm)

main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
from fractions import gcd
from itertools import count
from functools import lru_cache
from collections import defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok
#

def main():
    A, B = mis()
    print(A*B//gcd(A,B))

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

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

print (lcm)

Submission status: Accepted

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

Submission status: Accepted

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

def gcd(x, y):
    '''
    最大公約数の計算
    '''
    if y == 0:
        return x
    return gcd(y, x % y)

def lcm(x, y):
    '''
    最小公倍数の計算
    '''
    return (x * y) // gcd(x, y)

print(lcm(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:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

A,B = II()

import fractions
f = fractions.gcd(A,B)
f2 = A*B//f  
print(f2)

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    r = 1
    for i in reversed(range(2, min(A, B) + 1)):
        if A % i == 0 and B % i == 0:
            A //= i
            B //= i
            r *= i
    print(r * A * B)


main()

Submission status: Accepted

Solution code:
def examA():
    AB = [I() for _ in range(2)]
    for i in range(1,4):
        if not i in AB:
            ans = i
            break
    print(ans)
    return

def examB():
    N = I()
    S,T = LSI()
    ans = ""
    for i in range(N):
        ans += S[i]+T[i]
    print(ans)
    return

def gcd(x, y):
    if y == 0:
        return x
    while y != 0:
        x, y = y, x % y
    return x
def lcm(x, y):
    return x * y // gcd(x, y)
def examC():
    A, B = LI()
    ans = lcm(A,B)
    print(ans)
    return

def examD():
    return

def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examC()

Submission status: Accepted

Solution code:


def gcd(a,b):
  x = max([a,b])
  y = min([a,b])
  while y:
    x, y = y, x % y
  return x

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

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))
#>>>139
#>>>5560

Submission status: Accepted

Solution code:
def c_snack():
    from fractions import gcd
    A, B = [int(i) for i in input().split()]

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

print(c_snack())

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:
import fractions
A, B = list(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(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

#リスト内最小公倍数
print(lcm(a,b))

Submission status: Accepted

Solution code:
import sys
import math
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b = IL()

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

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
ans = A*B
if A>B: A,B = B,A
while A:
    A, B = B%A, A
print(ans//B)

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return(a)

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

Submission status: Accepted

Solution code:
def calc_gcd(a, b):
    if a < b:
        s, l = [a, b]
    else:
        s, l = [b, a]
    
    while True:
        r = l % s
        if r == 0:
            return s
        l = s
        s = r

def calc_lcm(a, b):
    gcd = calc_gcd(a, b)
    return (a // gcd) * (b // gcd) * gcd

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

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

ans = lcm(A, B)

print(ans)

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

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

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

Submission status: Accepted

Solution code:
#C
A,B = map(int,input().split())
def gcd(x,y):
    M = max(x,y)
    m = min(x,y)
    m2 = M%m
    if m2 == 0:
        return m
    else:
        return gcd(m2,m)
        
print(A*B//gcd(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:
import fractions

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

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

def solve():
    print(lcm(A, B))

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
c=a
d=b
while c!=d:
  if c>d:
    d+=b
  else:
    c+=a
print(c)

Submission status: Accepted

Solution code:
from fractions import gcd


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


if __name__ == '__main__':
    solve()

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:
# -*- coding: utf-8 -*-
import sys
from fractions import gcd
from string import ascii_uppercase as ABC
#input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))

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