Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import hashlib

n = int(input())
s = input()


objects = []
l = [[] for i in range(n//2+1)]


for i in range(n):
    objects.append(hashlib.md5())


for size in range(1, n//2+1):
    for i in range(n - size + 1):
        h = objects[i]
        h.update(s[i].encode())
        l[size].append(h.hexdigest())


def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(l[mid]):
            left = mid
        else:
            right = mid
    return left


def check(li):
        hashes = set()
        for h in li:
            if h in hashes:
                return True
            hashes.add(h)
        return False


print(output())

Fixed submission:
import hashlib

n = int(input())
s = input()


def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(mid):
            left = mid
        else:
            right = mid
    return left


def check(x):
    hashes = set()
    for i in range(n - 2*x + 1):
        hashes.add(s[i: i+x])
        if s[i+x: i+2*x] in hashes:
            return True
    return False


print(output())

Buggy python submission (verdict: Time Limit Exceeded):
import hashlib

n = int(input())
s = input()


objects = []
l = [[] for i in range(n//2+1)]


for i in range(n):
    objects.append(hashlib.md5())


for size in range(1, n//2+1):
    for i in range(n - size + 1):
        h = objects[i]
        h.update(s[i].encode())
        l[size].append(h.hexdigest())


def output():
    for size, li in zip(reversed(range(n//2+1)), reversed(l)):
        hashes = set()
        for h in li:
            if h in hashes:
                return size
            hashes.add(h)

    return 0

print(output())

Fixed submission:
import hashlib

n = int(input())
s = input()


def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(mid):
            left = mid
        else:
            right = mid
    return left


def check(x):
    hashes = set()
    for i in range(n - 2*x + 1):
        hashes.add(s[i: i+x])
        if s[i+x: i+2*x] in hashes:
            return True
    return False


print(output())

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

def compare(x0, x1):
    old_x1 = x1
    while x1 < n and s[x0] == s[x1] and x0 < old_x1:
        x0 += 1
        x1 += 1
    return x1-old_x1


m = 0
for i0 in range(n):
    for i1 in range(i0+1, n):
        m = max(compare(i0, i1), m)

print(m)

Fixed submission:
import hashlib

n = int(input())
s = input()


def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(mid):
            left = mid
        else:
            right = mid
    return left


def check(x):
    hashes = set()
    for i in range(n - 2*x + 1):
        hashes.add(s[i: i+x])
        if s[i+x: i+2*x] in hashes:
            return True
    return False


print(output())
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
arr = {}

for i in range(n):
    s = sys.stdin.readline().rstrip()
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1

dic = [key[0] for key in arr.items() if key[1] == max(arr.values())]
for i in sorted(dic):
    print(i)

Fixed submission:
n = int(input())
arr = {}

for i in range(n):
    s = input()
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1

max_count = max(arr.values())
dic = [key[0] for key in arr.items() if key[1] == max_count]

out_sort = sorted(dic)
for i in out_sort:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = {}

for i in range(n):
    s = input()
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1

dic = [key[0] for key in arr.items() if key[1] == max(arr.values())]
for i in sorted(dic):
    print(i)

Fixed submission:
n = int(input())
arr = {}

for i in range(n):
    s = input()
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1

max_count = max(arr.values())
dic = [key[0] for key in arr.items() if key[1] == max_count]

out_sort = sorted(dic)
for i in out_sort:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = []

for i in range(n):
    s = input()
    arr.append(s)
    
counter = 0
dic = []

for i in set(arr):
    c = arr.count(i)
    if counter < c:
        counter = c
        dic = []
        dic.append(i)
    elif counter == c:
        dic.append(i)
    else:
        continue

dic = sorted(dic)
for i in dic:
    print(i)


Fixed submission:
n = int(input())
arr = {}

for i in range(n):
    s = input()
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1

max_count = max(arr.values())
dic = [key[0] for key in arr.items() if key[1] == max_count]

out_sort = sorted(dic)
for i in out_sort:
    print(i)
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = list(map(int, input().split(" ")))

for i in range(x - 1):
  if y[i] < 0:
    y[i] *=-1
    y[i + 1] *=-1

if y[-1] < 0 and abs(min(y[0:-2])) < abs(y[-1]) :
  y[-1] *= -1
  y[y.index(min(y[0:-2]))] *= -1

print(sum(y))

Fixed submission:
x = int(input())
y = list(map(int, input().split(" ")))

for i in range(x - 1):
  if y[i] < 0:
    y[i] *=-1
    y[i + 1] *=-1

if y[-1] < 0 and abs(min(y[0:-1])) < abs(y[-1]) :
  y[-1] *= -1
  y[y.index(min(y[0:-1]))] *= -1

print(sum(y))

Buggy python submission (verdict: Runtime Error):
x = int(input())
y = list(map(int, input().split(" ")))

for i in range(x - 1):
  if y[i] < 0:
    y[i] *=-1
    y[i + 1] *=-1

if y[-1] < 0:
  y[-1] *= -1
  y[y.index(min(y[0:-2]))] *= -1
  
print(sum(y))

Fixed submission:
x = int(input())
y = list(map(int, input().split(" ")))

for i in range(x - 1):
  if y[i] < 0:
    y[i] *=-1
    y[i + 1] *=-1

if y[-1] < 0 and abs(min(y[0:-1])) < abs(y[-1]) :
  y[-1] *= -1
  y[y.index(min(y[0:-1]))] *= -1

print(sum(y))
Buggy python submission (verdict: Runtime Error):
import math

[n, m] = list(map(int, input().split()))
s = input()
t = input()

flag = False
gcd = math.gcd(n, m)
lcm = n * m // gcd
if s[0] == t[0]:
    if gcd == 1:
        flag = True
    else:
        if s[::lcm//len(t)] == t[::lcm//len(s)]:
            flag = True
if flag:
    print(lcm)
else:
    print(-1)

Fixed submission:
import fractions

[n, m] = list(map(int, input().split()))
s = input()
t = input()

flag = False
gcd = fractions.gcd(n, m)
lcm = n * m // gcd
if s[0] == t[0]:
    if gcd == 1:
        flag = True
    else:
        if s[::lcm//len(t)] == t[::lcm//len(s)]:
            flag = True
if flag:
    print(lcm)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
import math

[n, m] = list(map(int, input().split()))
s = input()
t = input()

flag = False
gcd = math.gcd(n, m)
lcm = n * m // gcd
if s[0] == t[0]:
    if gcd == 1:
        flag = True
    else:
        if s[::lcm//len(t)] == t[::lcm//len(s)]:
            flag = True
if flag:
    print(lcm)
else:
    print(-1)

Fixed submission:
import fractions

[n, m] = list(map(int, input().split()))
s = input()
t = input()

flag = False
gcd = fractions.gcd(n, m)
lcm = n * m // gcd
if s[0] == t[0]:
    if gcd == 1:
        flag = True
    else:
        if s[::lcm//len(t)] == t[::lcm//len(s)]:
            flag = True
if flag:
    print(lcm)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
import math

[N, M] = list(map(int, input().split()))
num = math.ceil(M / N)
if N > 1:
    num = min(num, int(math.sqrt(M+1)))
for i in range(num+1)[::-1]:
    if M % i == 0:
        print(i)
        break

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)

Buggy python submission (verdict: Runtime Error):
import math

[N, M] = list(map(int, input().split()))
num = math.ceil(M / N)
if N ==1:
    print(M)
for i in range(num+1)[::-1]:
    if M % i == 0:
        print(i)
        break

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):
import fractions.

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn = sorted(xn + [x])
gcd = xn[1] - xn[0]
b = xn[1]
for a in xn[2:]:
    gcd = fractions..gcd(b - a, gcd)
    b = a
print(gcd)

Fixed submission:
import fractions
from functools import reduce
import numpy as np

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn += [x]
xn = np.abs(np.diff(xn))
print(reduce(fractions.gcd, xn))

Buggy python submission (verdict: Runtime Error):
import math

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn = sorted(xn + [x])
gcd = xn[1] - xn[0]
b = xn[1]
for a in xn[2:]:
    gcd = math.gcd(b - a, gcd)
    b = a
print(gcd)

Fixed submission:
import fractions
from functools import reduce
import numpy as np

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn += [x]
xn = np.abs(np.diff(xn))
print(reduce(fractions.gcd, xn))
Buggy python submission (verdict: Runtime Error):
def check(t):
    return 1 if t is '#' else 0
    
def main(H, W, S):
    for i in range(H):
        for j in range(W):
            if S[i][j] is '.':
                S[i][j] = check(S[i][max(j-1, 0)]) + check(S[i][min(j+1, W-1)]) + check(S[max(i-1, 0)][j]) + check(S[min(i+1, H-1)][j])
    return S


H, W = map(int, input().split())
S = [input().split() for i in H]
print(main(H, W, S))

Fixed submission:
def main(argv):
    for i in range(len(argv)):
        check = sum(argv[i] == argv[j] for j in range(len(argv)))
        if check != len(argv)-1:
            return argv[i]


argv = list(map(int, input().split()))
print(main(argv))

Buggy python submission (verdict: Runtime Error):
def main(argv):
    for v in argv:
        print(v)

main()

Fixed submission:
def main(argv):
    for i in range(len(argv)):
        check = sum(argv[i] == argv[j] for j in range(len(argv)))
        if check != len(argv)-1:
            return argv[i]


argv = list(map(int, input().split()))
print(main(argv))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(int(a*b*//2))

Fixed submission:
a,b,c = map(int, input().split())
print(int(a*b*0.5))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(int(a*b*0.5))

Fixed submission:
a,b,c = map(int, input().split())
print(int(a*b*0.5))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
input()
print(int(a+b/2))

Fixed submission:
a,b,c = map(int, input().split())
print(int(a*b*0.5))
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
i=1
while true:
  if N<K^i:
    print(i)
    break
  else:
    i = i + 1


Fixed submission:
import math

N, K = map(int,input().split())
if N==1:
  print(1)
else:
  print(math.ceil(math.log(N, K)))
Buggy python submission (verdict: Runtime Error):
import sys
Row=int(input())
 

X = map(int, input().strip())
 
res = float('inf')
for i in range(1, 101):
  cur_res = 0
  for j in X:
    cur_res = cur_res + (j-i)^2
  if cur_res < res:
    res = cur_res
 
print(res)


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

res=0
for i in Xs:
    res = res + (i-round(sum(Xs)/N))**2

print(res)

Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()
 
N, X = lines.strip("\n")
X = map(int, X.strip())
 
res = float('inf')
for i in range(1, 101):
  cur_res = 0
  for j in X:
    cur_res = cur_res + (j-i)^2
  if cur_res < res:
    res = cur_res
 
print(res)

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

res=0
for i in Xs:
    res = res + (i-round(sum(Xs)/N))**2

print(res)

Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()
 
N, X = lines.strip("\n")
X = map(int, X.strip(" "))
 
res = float('inf')
for i in range(1, 101):
  cur_res = 0
  for j in X:
    cur_res = cur_res + (j-i)^2
  if cur_res < res:
    res = cur_res
 
print(res)

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

res=0
for i in Xs:
    res = res + (i-round(sum(Xs)/N))**2

print(res)

Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()
 
N, X = lines.strip("\n")
X = map(int, X.strip(" "))
 
res = float('inf')
for i in Range(1, 101):
  cur_res = 0
  for j in X:
    cur_res = cur_res + (j-i)^2
  if cur_res < res:
    res = cur_res
 
print(cur_res)

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

res=0
for i in Xs:
    res = res + (i-round(sum(Xs)/N))**2

print(res)

Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()

N, X = lines.strip("\n")
X = X.strip(" ")

res = float('inf')
for i in Range(1, 101):
  cur_res = 0
  for j in X:
    cur_res = cur_res + (j-i)^2
  if cur_res < res:
    res = cur_res

print(cur_res)

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

res=0
for i in Xs:
    res = res + (i-round(sum(Xs)/N))**2

print(res)
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

Buggy python submission (verdict: Runtime Error):
A=int(input("a"))
B=int(input("b"))

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)
Buggy python submission (verdict: Runtime Error):
N=input()
print(N**3)

Fixed submission:
N=int(input())
print(N**3)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
cout = 1
for i in ranga(N):
    N = N//K
    cout += 1
    if N<K:
        break
print(cout)

Fixed submission:
N, K = map(int, input().split())
cout = 1
for i in range(N):
    if N<K:
        break
    N = N//K
    cout += 1

print(cout)
Buggy python submission (verdict: Runtime Error):
import collections
from collections import OrderedDict

#入力
N = int(input())
S = [input() for i in range(N)]

#出現回数のカウント
c = OrderedDict(collections.Counter(S))
ln = len(c.values())

#多い順に並べ替えた辞書をつくる
d = OrderedDict(sorted(c.items(), key = lambda x : x[1], reverse=True))
dval = list(d.values())
dkey = list(d.keys())

#回数が多い単語を抜き出したリストの制作
word = list()
word.append(dkey[0])
i=1
if ln>1:
    while dval[i-1]==dval[i]:
        word.append(dkey[i])
        i+=1
        if i==ln:
            break

#辞書順に並べ替える
dic = sorted(word)

#表示
for i in range(len(dic)):
    print(dic[i])

Fixed submission:
N = input().split()
A = N[0]
B = N[1]
C = N[2]

if A==B==C:
    print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()

if A==B==C:
    print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
    print("No")

Fixed submission:
N = input().split()
A = N[0]
B = N[1]
C = N[2]

if A==B==C:
    print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
def main():
	a = {"SUN" : 0,
	"SAT" : 6,
	"FRI" : 5,
	"THI" : 4, 
	"WED" : 3,
	"TUE" : 2,
	"MON" : 1}
	s = input()
	print(7-a[s])
	
main()


Fixed submission:
def main():
	a = {"SUN" : 0,
	"SAT" : 6,
	"FRI" : 5,
	"THU" : 4, 
	"WED" : 3,
	"TUE" : 2,
	"MON" : 1}
	s = input()
	print(7-a[s.strip()])
	
main()
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
md = []
while N != 0:
  md.append(N%K)
  N /= K
print(len(md)+1)

Fixed submission:
N, R = map(int, input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
N, R = map(int, input().spit())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Fixed submission:
N, R = map(int, input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
N, R = map(int, input().spit())
if R < 10:
  print(R+100*(10-N))
else:
  print(R)

Fixed submission:
N, R = map(int, input().split())
if N < 10:
  print(R+100*(10-N))
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
i = input().split()

N = int(i[0])
K = int(i[1])

result = ''
tmp = N
while tmp >= K:
    idx = str(tmp % K)
    result = idx + result
    tmp = int(tmp / K)
idx = str(tmp % K)
result = idx + result

print(result)

Fixed submission:
i = input().split()

N = int(i[0])
R = int(i[1])

IR = 0

if N >= 10 :
    IR = R
else :
    IR = R + 100 * (10 - N)

print(IR)
Buggy python submission (verdict: Runtime Error):
import sys

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

for x in A:
    if (x % 2 == 0) and (x % 3 != 0) and (x % 5 != 0):
        print('DENIED')
        sys.exit()

print ('APPROVED')


Fixed submission:
i = list(map(int, input().split()))
a = i[0]
b = i[1]
c = i[2]

isPoor = False

if (a == b or a == c) and b != c:
    isPoor = True
elif (b == a or b == c ) and a != c:
    isPoor = True
elif (c == a or c == b) and a != b:
    isPoor = True

if isPoor:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = list(map(int, input().split()))
A = list(map(int, input().split()))

isApprove = True

for x in A:
    if x % 2 == 0:
        if (x % 3 != 0) or (x % 5 != 0):
            isApprove = False
            break
        
if isApprove:
    print ('APPROVED')
else:
    print('DENIED')


Fixed submission:
i = list(map(int, input().split()))
a = i[0]
b = i[1]
c = i[2]

isPoor = False

if (a == b or a == c) and b != c:
    isPoor = True
elif (b == a or b == c ) and a != c:
    isPoor = True
elif (c == a or c == b) and a != b:
    isPoor = True

if isPoor:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = list(map(int, input().split()))
A = list(map(int, input().split()))

isApprove = True

for x in A:
    if x % 2 == 0:
        if (x % 3 != 0) or (x % 5 != 0):
            isApprove = True
            print('DENIED')
            return 

print ('APPROVED')

Fixed submission:
import sys

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

for x in A:
    if (x % 2 == 0) and (x % 3 != 0) and (x % 5 != 0):
        print('DENIED')
        sys.exit()

print ('APPROVED')
Buggy python submission (verdict: Runtime Error):
n,r=(int,input().split())
print(r if n>=10 else r+(100*(10-n)))

Fixed submission:
n,r=map(int,input().split())
if(n>=10):
  print(r)
else:
  print(r+(100*(10-n)))
Buggy python submission (verdict: Runtime Error):
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

balls = {s:a, t:b}

for key in balls:
    if key == u:
        balls[key] = balls[key] - 1

listBalls = list(balls.values())
print(f'{listBalls[0]} {listBalls[1]}')

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

if s == u:
  a -= 1
else:
  b -= 1

print(a, b)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, p: "List[int]", S: "List[str]"):
    d = dict([(i, []) for i in set(p)])
    for _p, _s in zip(p, S):
        d[_p].append(_s)
    # print(d)
    A = 0
    W = 0
    for v in d.values():
        _a = v.index('AC')
        # print(_a)
        A += 1
        W += _a
    print(A, W)


# 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()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    p = [int()] * (M)  # type: "List[int]"
    S = [str()] * (M)  # type: "List[str]"
    for i in range(M):
        p[i] = int(next(tokens))
        S[i] = next(tokens)
    solve(N, M, p, S)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, p: "List[int]", S: "List[str]"):
    A = [False] * (N+1)
    W = [0] * (N+1)
    wans = 0
    for _p, _s in zip(p, S):
        if A[_p]:
            continue
        if _s == 'WA':
            W[_p] += 1
        else:
            A[_p] = True
            wans += W[_p]
    ans = sum(A)
    print(ans, wans)


# 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()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    p = [int()] * (M)  # type: "List[int]"
    S = [str()] * (M)  # type: "List[str]"
    for i in range(M):
        p[i] = int(next(tokens))
        S[i] = next(tokens)
    solve(N, M, p, S)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import numpy as np
import sys


def solve(A: int, B: int):
    print(np.lcm(A, B))

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


Fixed submission:
#!/usr/bin/env python3
import fractions
# import numpy as np
import sys


def solve(A: int, B: int):
    ans = (A * B) // fractions.gcd(A, B)
    # print(np.lcm(A, B))
    print(ans)

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

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
import sys

def solve(A: int, B: int):
    lcm = (A * B) // math.gcd(A, B)
    print(lcm)


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


Fixed submission:
#!/usr/bin/env python3
import fractions
# import numpy as np
import sys


def solve(A: int, B: int):
    ans = (A * B) // fractions.gcd(A, B)
    # print(np.lcm(A, B))
    print(ans)

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