Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# from collections import deque
# from collections import defaultdict
import itertools
# import math
# import numpy as np
# from scipy.special import comb
# import heapq


def main():
    N, W = map(int, input().split())
    v = [0] * (N + 1)
    w = [0] * (N + 1)

    for i in range(1, N + 1):
        v[i], w[i] = map(int, input().split())

    values = [[0 for _ in range(W + 1)] for _ in range(N + 1)]

    for i in range(0, N + 1):
        for j in range(0, W + 1):
            non_choice = values[i - 1][j]
            if j >= w[i]:
                choice = values[i - 1][j - w[i]] + v[i]
            else:
                choice = 0
            values[i][j] = max(choice, non_choice)

    print(max(list(itertools.chain(*values))))


if __name__ == '__main__':
    main()


Fixed submission:
from collections import deque

N, M = map(int, input().split())

links = [[] for _ in range(N + 1)]

for _ in range(M):
    A, B = map(int, input().split())
    links[A].append(B)
    links[B].append(A)

dist = [-1] * (N + 1)
michi = [-1] * (N + 1)
dist[1] = 0
q = deque([1])

while q:
    now = q.popleft()
    for i in links[now]:
        if dist[i] == -1:
            dist[i] = dist[now] + 1
            michi[i] = now
            q.append(i)

print('Yes')
for i in range(2, N + 1):
    print(michi[i])

Buggy python submission (verdict: Runtime Error):
# from collections import deque
# from collections import defaultdict
# import itertools
# import math
import numpy as np
# from scipy.special import comb
# import heapq


def main():
    N, W = map(int, input().split())
    v = [0] * (N + 1)
    w = [0] * (N + 1)

    for i in range(1, N + 1):
        v[i], w[i] = map(int, input().split())

    values = [[0 for _ in range(W + 1)] for _ in range(N + 1)]

    for i in range(0, N + 1):
        for j in range(0, W + 1):
            non_choice = values[i - 1][j]
            if j >= w[i]:
                choice = values[i - 1][j - w[i]] + v[i]
            else:
                choice = 0
            values[i][j] = max(choice, non_choice)

    print(np.max(np.array(values)))


if __name__ == '__main__':
    main()


Fixed submission:
from collections import deque

N, M = map(int, input().split())

links = [[] for _ in range(N + 1)]

for _ in range(M):
    A, B = map(int, input().split())
    links[A].append(B)
    links[B].append(A)

dist = [-1] * (N + 1)
michi = [-1] * (N + 1)
dist[1] = 0
q = deque([1])

while q:
    now = q.popleft()
    for i in links[now]:
        if dist[i] == -1:
            dist[i] = dist[now] + 1
            michi[i] = now
            q.append(i)

print('Yes')
for i in range(2, N + 1):
    print(michi[i])
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN and not C_MIN == -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(int(C_MIN))

Fixed submission:
S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN and not C_MIN == -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(C_MIN)

Fixed submission:
S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN and C_MIN not -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(int(C_MIN))

Fixed submission:
S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = 9999999999
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN:
            C_MIN = C_SUM
            
if C_MIN == 9999999999:
    print("-1")
else:
    print(C_MIN)

Fixed submission:
S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN or C_MIN == -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(int(C_MIN))

Fixed submission:
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN or C_MIN == -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(int(C_MIN))

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = 9999999999
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN:
            C_MIN = C_SUM
            
if C_MIN == 9999999999:
    print("-1")
else:
    print(C_MIN)

Fixed submission:
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN or C_MIN == -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(int(C_MIN))
Buggy python submission (verdict: Runtime Error):
class Combination:

    """
    n_max = 10**6のとき前処理は約950ms(PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """

    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * \
                modinv[self.mod % i] % self.mod
        return modinv


N, M, K = map(int, input().split())
mod = 998244353
comb = Combination(N-1, mod)

ans = 0
for k in range(K+1):
    t1 = M % mod
    t2 = pow(M-1, N-1-k, mod)
    t3 = comb(N-1, k)
    ans = (ans + t1 * t2 * t3) % mod

print(ans)


Fixed submission:
class Combination:

    """
    (使用例)
    comb = Combination(n_max, mod)
    comb(n, r)

    (注意)
    n_max != 0
    """

    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * \
                modinv[self.mod % i] % self.mod
        return modinv


N, M, K = map(int, input().split())
mod = 998244353
comb = Combination(N, mod)

ans = 0
for k in range(K+1):
    t1 = M % mod
    t2 = pow(M-1, N-1-k, mod)
    t3 = comb(N-1, k)
    ans = (ans + t1 * t2 * t3) % mod

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
tmp_A = list(map(int, input().split()))
A = [0] + tmp_A

tmp_A = sorted(tmp_A)
min_h = sum(tmp_A[0:2])
max_h = sum(tmp_A[-2:])

ans = 0
for n in range(1, N + 1):
    now_h = A[n]
    min_i = max(n + 1, min(min_h, N))
    max_i = min(max_h + n + 1, N + 1)
    for i in range(min_i, max_i):
        if A[n] + A[i] is abs(n - i):
            ans += 1

print(ans)


Fixed submission:
from collections import defaultdict

N = int(input())
A = [0] + list(map(int, input().split()))
d = defaultdict(int)

ans = 0
for i in range(1, N + 1):
    d[A[i] + i] += 1  # Ai + iを数える
    ans += d[i - A[i]]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

max_num = 0
for x in range(1, N+1):
    t = math.floor(A * x / B) - A * math.floor(x / B)
    if t > max_num:
        max_num = t

print(max_num)

Fixed submission:
def main():
    A, B, N = map(int, input().split())
    x = min(B-1, N)
    ans = int((A*x)/B) - A*int(x/B)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = input()
s.reverse()
l = len(s)
se = dict()

k = 0
for i in range(0,l):
    k+=(pow(10,i,2019)*int(s[i]))
    k%=2019
    if k in se:
        se[k]+=1
    else:
        se[k]=1

ans=0
for j in se:
    i=se[j]
    if i>1:
        ans+=(i*(i-1)//2)
    if j==0:
        ans+=i
print(ans)

Fixed submission:
s=input()
l=len(s)
se=dict()
k=0
for i in range(l-1,-1,-1):
    k+=(pow(10,l-1-i,2019)*int(s[i]))
    k%=2019
    if k in se:
        se[k]+=1
    else:
        se[k]=1

ans=0
for j in se:
    i=se[j]
    if i>1:
        ans+=(i*(i-1)//2)
    if j==0:
        ans+=i
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = input

for i in range(10 ** 10):
  a = 1 + 1

Fixed submission:
s=input()
l=len(s)
se=dict()
k=0
for i in range(l-1,-1,-1):
    k+=(pow(10,l-1-i,2019)*int(s[i]))
    k%=2019
    if k in se:
        se[k]+=1
    else:
        se[k]=1

ans=0
for j in se:
    i=se[j]
    if i>1:
        ans+=(i*(i-1)//2)
    if j==0:
        ans+=i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = [0] * (N+1)

for i in range(1, N+1):
    ans[i] = A.count(i)

for a in ans[1:]:
    print(a)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

ans = [0] * (N+1)

for a in A:
    ans[a] += 1

for a in ans[1:]:
    print(a)
Buggy python submission (verdict: Runtime Error):
# import sys
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007

def main():

    N = int(input())
    A, B = map(int, input().split())
    L = list(map(int, input().split()))


if __name__ == '__main__':
    main()


Fixed submission:
# import sys
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()

def main():
    N, K = map(int, input().split())
    dt = N//K
    ans = min(abs(N - dt * K), abs(N - (dt+1)*K))
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# import sys
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007

def main():

    N, M = map(int, input().split())

    keta = [-1] * N

    flag = True
    for _ in range(M):
        s, c = map(int, input().split())
        s = s - 1

        if s == 0 and c == 0:
            flag = False

        if keta[s] == -1:
            keta[s] = c
        else:
            if not keta[s] == c:
                flag = False

    if keta[0] == -1:
        keta[0] = 1

    for i in range(1, M):
        if keta[i] == -1:
            keta[i] = 0

    if flag:
        print(int(''.join(map(str, keta))))
    else:
        print("-1")


if __name__ == '__main__':
    main()


Fixed submission:
# import sys
# import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007

def main():

    N, M = map(int, input().split())

    keta = [-1] * N

    flag = True
    for _ in range(M):
        s, c = map(int, input().split())
        s = s - 1

        if s == 0 and c == 0 and N > 1:
            flag = False

        if keta[s] == -1:
            keta[s] = c
        else:
            if not keta[s] == c:
                flag = False

    if keta[0] == -1:
        if N > 1:
            keta[0] = 1
        elif N == 1:
            keta[0] = 0

    for i in range(1, N):
        if keta[i] == -1:
            keta[i] = 0

    if flag:
        print(int(''.join(map(str, keta))))
    else:
        print("-1")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))

    for i in range(N):
        p[i] = (p[i] + 1) / 2

    ans = 0
    for i in range(N - K + 1):
        ans = max(ans, sum(p[i:i + K]))

    print(ans)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import numpy as np

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())
    p = np.array(list(map(int, input().split())), dtype='f8')
    p = (p + 1) / 2
    rs = np.zeros(N + 1, dtype='f8')
    for i in range(N):
        rs[i + 1] = rs[i] + p[i]
    ans = 0
    for i in range(N - K + 1):
        ans = max(ans, rs[i + K] - rs[i])

    print(ans)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))
    p = np.array(p, dtype='f8')
    p = (p + 1) / 2

    ans = 0
    for i in range(N - K + 1):
        ans = max(ans, np.sum(p[i:i + K]))

    print(ans)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import numpy as np

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())
    p = np.array(list(map(int, input().split())), dtype='f8')
    p = (p + 1) / 2
    rs = np.zeros(N + 1, dtype='f8')
    for i in range(N):
        rs[i + 1] = rs[i] + p[i]
    ans = 0
    for i in range(N - K + 1):
        ans = max(ans, rs[i + K] - rs[i])

    print(ans)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = lambda: sys.stdin.readline().rstrip()
INF = 10 ** 9 + 7

H, N = map(int, input().split())
AB = [[] for _ in range(N)]
for i in range(N):
    AB[i] = list(map(int, input().split()))


def solve():

    dp = [INF] * (H + 1)
    dp[H] = 0

    for h in range(H, 0, -1):

        if dp[h] == INF:
            continue
        next_dp = dp

        for i in range(N):
            a, b = AB[i]
            hh = max(0, h - a)
            next_dp[hh] = min(dp[hh], dp[h] + b)

        dp = next_dp

    print(dp[0])


if __name__ == '__main__':
    solve()


Fixed submission:
import sys

input = lambda: sys.stdin.readline().rstrip()
INF = 10 ** 9 + 7

H, N = map(int, input().split())
AB = [[] for _ in range(N)]
for i in range(N):
    AB[i] = list(map(int, input().split()))


def solve():

    dp = [INF] * (H + 1)
    dp[H] = 0

    for h in range(H, 0, -1):

        if dp[h] == INF:
            continue
        next_dp = dp

        for i in range(N):
            a, b = AB[i]
            hh = max(0, h - a)
            next_dp[hh] = min(dp[hh], dp[h] + b)

        dp = next_dp

    print(dp[0])


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import fractions
input = lambda: sys.stdin.readline().rstrip()

mod = 10**9 + 7


def solve():
    N = int(input())
    A = list(map(int, input().split()))

    lcm = A[0]
    for i in range(1, N):
        lcm = lcm * A[i] // fractions.gcd(lcm, A[i])

    B = [lcm // a for a in A]

    ans = 0
    for i in range(N):
        ans += B[i]
        ans %= mod

    print(ans)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import math
import fractions
from collections import defaultdict
input = lambda: sys.stdin.readline().rstrip()

mod = 10**9 + 7


def factorize(n):
    b = 2
    fct = defaultdict(lambda: 0)
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct[b] += 1
        b = b + 1
    if n > 1:
        fct[n] += 1
    return fct


def divmod(x, mod=10**9 + 7):
    return pow(x, mod - 2, mod)


def solve():

    N = int(input())
    A = list(map(int, input().split()))
    B = [[1] for _ in range(N)]

    fac_list = defaultdict(lambda: 0)
    for i in range(N):
        d = factorize(A[i])
        for k, v in d.items():
            fac_list[k] = max(fac_list[k], v)

    lcm = 1
    for k, v in fac_list.items():
        lcm *= (k**v)
        lcm %= mod

    ans = 0
    for i in range(N):
        ans += divmod(A[i])
        ans %= mod

    ans *= lcm
    ans %= mod
    print(ans)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import fractions
input = lambda: sys.stdin.readline().rstrip()

mod = 10**9 + 7


def solve():
    N = int(input())
    A = list(map(int, input().split()))

    lcm = A[0]
    for i in range(1, N):
        lcm = lcm * A[i] // fractions.gcd(lcm, A[i])

    B = [lcm // a for a in A]

    ans = 0
    for i in range(N):
        ans += B[i]
        ans %= mod

    print(ans)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import math
import fractions
from collections import defaultdict
input = lambda: sys.stdin.readline().rstrip()

mod = 10**9 + 7


def factorize(n):
    b = 2
    fct = defaultdict(lambda: 0)
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct[b] += 1
        b = b + 1
    if n > 1:
        fct[n] += 1
    return fct


def divmod(x, mod=10**9 + 7):
    return pow(x, mod - 2, mod)


def solve():

    N = int(input())
    A = list(map(int, input().split()))
    B = [[1] for _ in range(N)]

    fac_list = defaultdict(lambda: 0)
    for i in range(N):
        d = factorize(A[i])
        for k, v in d.items():
            fac_list[k] = max(fac_list[k], v)

    lcm = 1
    for k, v in fac_list.items():
        lcm *= (k**v)
        lcm %= mod

    ans = 0
    for i in range(N):
        ans += divmod(A[i])
        ans %= mod

    ans *= lcm
    ans %= mod
    print(ans)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
# import sys
import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007


def main():

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


if __name__ == '__main__':
    main()


Fixed submission:
import fractions

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

Buggy python submission (verdict: Runtime Error):
# import sys
import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007


def main():

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


if __name__ == '__main__':
    main()


Fixed submission:
import fractions

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