Problem:


Score : 300 points

Problem Statement

Takahashi is organizing a party.

At the party, each guest will receive one or more snack pieces.

Takahashi predicts that the number of guests at this party will be A or B.

Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.

We assume that a piece cannot be divided and distributed to multiple guests.

Constraints

1 \leq A, B \leq 10^5

A \neq B

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.

Sample Input 1

2 3

Sample Output 1

6

When we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.

Sample Input 2

123 456

Sample Output 2

18696

Sample Input 3

100000 99999

Sample Output 3

9999900000



Sample input:
2 3


Sample output:
6

Submission status: Accepted

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


def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = x * a[i] // gcd(x, a[i])
    return x


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

#互除法(最大公約数)
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)

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

Submission status: Accepted

Solution code:

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

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


def main():

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

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

    return 0

if __name__ == "__main__":
    solve()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

def main():
    buf = input()
    buflist = buf.split()
    a = int(buflist[0])
    b = int(buflist[1])

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

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def gcd(m, n):
    while n:
        m, n = n, m % n
    return m


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

print(A*B//g)

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

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

Submission status: Accepted

Solution code:
from fractions import gcd
a,b=map(int,input().split())
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(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

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

Submission status: Accepted

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


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

Submission status: Accepted

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


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


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


print(lcm(A, B))

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
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())
from fractions import gcd
g = gcd(a, b)
print((a*b)//g)

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)
if A < B:
    gcd = gcd(B,A)
    print(int(A*B//gcd))
else:
    gcd = gcd(A,B)
    print(int(A*B//gcd))

Submission status: Accepted

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

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

# aとbの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

# aとbの最小公倍数
# a*b = lcm(a,b)*gcd(a,b) より
def lcm(a,b):
    return a*b//gcd(a,b)

print(lcm(A,B))

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y)
print(A*B//gcd(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:
#!/usr/bin/env python3
import fractions

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

print(ans)

Submission status: Accepted

Solution code:
import copy
import heapq
import math
import fractions

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printrow(a):
    for i in a:
        print(i)


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

x,y = ips()
print(lcm(x,y))

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import fractions


def main():
    a, b = (int(z) for z in input().split())
    x = a // fractions.gcd(a, b) * b
    print(x)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd

S, T = map(int, input().split())

print(S * T // gcd(S, T))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
def gcd(x, y):
    if x<y:x,y=y,x
    while x % y != 0:
        x, y = y, x % y
    return y

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

Submission status: Accepted

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

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

Submission status: Accepted

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

from fractions import gcd
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())
mi = min(A,B)
ma = max(A,B)
i = 1

while True:
    num = ma * i
    if num % mi == 0:
        break
    else:
        i += 1

print(num)

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 // gcd(a, b) * 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=map(int,input().split())
from fractions import gcd
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 = [int(i) for i in input().split()]
print(int(lcm(a, b)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
from fractions import gcd
print(A*B // gcd(A, B))

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
def lcm(x,y):return x*y//gcd(x,y)
def lcmm(l):return reduce(lcm,l)
A, B = map(int,input().split())
List=[A, B]
print(lcmm(List))

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

Submission status: Accepted

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

from fractions import gcd
ans = (x * y) // gcd(x, y)
print(ans)

Submission status: Accepted

Solution code:
import sys
a, b = [int(i) for i in sys.stdin.readline().split()]

def gcd(a, b):
    while a and b:
        if a > b:
            a %= b
        else:
            b %= a
    return max(a, b)

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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())

from fractions import gcd

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

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
import fractions
# 2数を受け取って最小公倍数を返す関数
def lcm(a, b):
    y = a*b / fractions.gcd(a, b)
    return int(y)

print(lcm(A,B))

Submission status: Accepted

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


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

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

def lcm(x, y):
    return (x*y) // math.gcd(x, y)
A, B = map(int, input().split())
print(lcm(A, B))

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

import fractions
from functools import reduce
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

a,b = m()

print(lcm(a,b))

Submission status: Accepted

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

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

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:
# 最小公倍数
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 inpl():
    return list(map(int, input().split()))


def gcd(a, b):
    # greatest common divisor
    while b > 0:
        a, b = b, a % b

    return a


def lcm(a, b):
    # least common multiple
    return a * b // gcd(a, b)


A, B = inpl()

print(lcm(max(A, B), min(A, B)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(p, q):
    if p < q:
        p, q = q, p
    while q > 0:
        p, q = q, p%q
    return p

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

def main():
    a,b=MI()
    print(a*b//gcd(a,b))

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
big,sml = a,b
while sml != 0:
  big,sml = sml,big%sml
print(a*b//big)

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:
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 sys
import fractions
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict
from fractions import gcd
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	A, B = getlist()
	GCD = gcd(A, B)
	ans = int(A * B // GCD)
	print(ans)


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
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())
f=fractions.gcd(a,b)
f2=a*b//f
print(f2)

Submission status: Accepted

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

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

def lcm(a, b):
    g = gcd(a, b)
    g_a = a // g
    g_b = b // g
    return g_a * g_b * g

print(lcm(a, b))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline

a,b = list(map(int,input().split()))
#最小公倍数(least common multiple)
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())
print((a*b)//gcd(a,b))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
from fractions import gcd

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


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


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B):
    c = gcd(A, B)
    ans = (A * B) // c
    return ans


def main():
    A, B = read_int_n()
    print(slv(A, B))


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

import fractions

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

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
input = sys.stdin.readline
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):
	while b:
		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

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

Submission status: Accepted

Solution code:
from fractions import gcd

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

Submission status: Accepted

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

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

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

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)

print(A*B//G)

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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

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

# 最小公倍数
# ユークリッドの互除法
def lcm(a, b): 
    def gcd(a, b):  # a >= b
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    return a * b // gcd(a, b)

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 1 << 100
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


def gcd(i, j):
    while j:
        i, j = j, i % j
    return i


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

Submission status: Accepted

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

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

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

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

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

    g = gcd(a, b)
    return a * b // g



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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
def gcd(a:int, b:int):
    while b:
        a,b = b,a%b
    return a

def lcm(a:int, b:int):
    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 = map(int, input().split())
def gcd(n, m):
    # 最大公約数
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return a

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

Submission status: Accepted

Solution code:
# coding: utf-8
try:
    from fractions import gcd
except:
    from math import gcd
A, B = map(int, input().split())
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:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]


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


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


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

Submission status: Accepted

Solution code:
from fractions import gcd

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

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

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
from fractions import gcd
def resolve():
    a,b=map(int,input().split())
    print(a*b//gcd(a,b))
resolve()

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:

S,T=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(S,T))

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:
#!/usr/bin/env python3
import sys
INF = float("inf")


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


def LCM(a, b):
    return a*b//GCD(a, b)


def solve(A: int, B: int):
    print(LCM(A, B))
    return


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

Submission status: Accepted

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

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

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


print(lcm(A, B))

Submission status: Accepted

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

def lcm_core(a,b):
    g = gcd_core(a,b)
    return (a*b)//g


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import fractions
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
write = sys.stdout.write
def ii(): return int(readline())
def mi(): return map(int, readline().rstrip().split())
def li(): return list(readline().rstrip())
def lmi(): return list(map(int, readline().rstrip().split()))
def end(*arg): print(*arg); sys.exit()
# template


def main():
    A, B = mi()
    print(A * B // fractions.gcd(A, B))
    return


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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x*y/gcd(x,y)
# LCM --- END ---

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

  return int(lcm(a,b))

# main()
print(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:
a,b=[int(j) for j in input().split()]
def gcd(x,y):
    if y==0:
        return x
    else:
        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 sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B=MI()
    print(A*B//gcd(A,B))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def GCM(a, b):
  if a < b:
    a, b = b, a
  r = a % b
  if r == 0:
    return b
  else:
    return GCM(b, r)

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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