Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
from sys import stdin
s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()
N, M = ds_in()
info_list = []
for _ in range(M):
    info_list.append(ds_in())
info_list = np.array(info_list)
ordered = np.argsort(info_list[:, 1])
pref_count = np.zeros(N)
ans_list = ['' for _ in range(M)]
for i in ordered:
    pref = info_list[i, 0]
    pref_count[pref - 1] += 1
    ans_list[i] = '%06d%06d' % (pref, pref_count[pref - 1])
for a in ans_list:
    print(a)

Fixed submission:
from sys import stdin
import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()
N, M = ds_in()
info_list = []
for _ in range(M):
    info_list.append(ds_in())
info_list = np.array(info_list)
ordered = np.argsort(info_list[:, 1])
pref_count = np.zeros(N)
ans_list = ['' for _ in range(M)]
for i in ordered:
    pref = info_list[i, 0]
    pref_count[pref - 1] += 1
    ans_list[i] = '%06d%06d' % (pref, pref_count[pref - 1])
for a in ans_list:
    print(a)
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
div1 = 0,div2 = 0
if h%3==0 or w%3==0:
	print("0")
else:
	div1 = min(h, w)
	def div2(h, w):
		m = h*w
		for l in range(1, w):
			s = [l*h, (w-l)*(h-h//2), (w-l)*(h//2)]
			m = min(m, max(s)-min(s))
		return m
	div2 = min(div2(h, w), div2(w, h))
	print(min(div1, div2))


Fixed submission:
h, w = map(int, input().split())
div1 = 0
div2 = 0
if h%3==0 or w%3==0:
	print("0")
else:
	div1 = min(h, w)
	def div2(h, w):
		m = h*w
		for l in range(1, w):
			s = [l*h, (w-l)*(h-h//2), (w-l)*(h//2)]
			m = min(m, max(s)-min(s))
		return m
	div2 = min(div2(h, w), div2(w, h))
	print(min(div1, div2))
Buggy python submission (verdict: Runtime Error):
w, h, n = map( int, input().split())
l = 0,r = w,d = 0,u = h
for _ in range(n):
    x, y, a = map( int, input().split())
    if a == 1:
        l = max(l,x)
    elif a == 2:
        r = min(r,x)
    elif a == 3:
        d = max(d,y)
    else:
        u = min(u,y)
if r-l <= 0 or u-d <= 0:
    print(0)
else:
    print(max(0,(r-l)*(u-d)))

Fixed submission:
w, h, n = map( int, input().split())
l = 0
r = w
d = 0
u = h
for _ in range(n):
    x, y, a = map( int, input().split())
    if a == 1:
        l = max(l,x)
    elif a == 2:
        r = min(r,x)
    elif a == 3:
        d = max(d,y)
    else:
        u = min(u,y)
if r-l <= 0 or u-d <= 0:
    print(0)
else:
    print(max(0,(r-l)*(u-d)))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n=int(input())
  heights=list(map(int,input().split()))
  assert len(heights)==n
  i=0
  count=0

  while i<n:
    j=i+1
    while j<n:
        if heights[i]+heights[j]==(j-i):
            count+=1
        j+=1
    i+=1
  print(count)
main()

Fixed submission:
def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    from collections import defaultdict
    count = defaultdict(int)
    ans = 0
    for i, a in enumerate(A):
        if i - a in count:
            ans += count[i-a]
        count[i+a] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
  n=int(input())
  heights=list(map(int,input().split()))
  assert len(heights)==n
  i=0
  count=0
  while i<n:
    j=i+1
    while j<n:
      if heights[i]+heights+[j]==(j-i):
        count+=1
  print(count)
main()

Fixed submission:
def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    from collections import defaultdict
    count = defaultdict(int)
    ans = 0
    for i, a in enumerate(A):
        if i - a in count:
            ans += count[i-a]
        count[i+a] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
  n=int(input())
  heights=list(map(int,input.split()))
  assert len(heights)==n
  i=0
  count=0
  while i<n:
    j=i+1
    while j<n:
      if heights[i]+heights+[j]==(j-i):
        count+=1
  print(count)
main()

Fixed submission:
def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    from collections import defaultdict
    count = defaultdict(int)
    ans = 0
    for i, a in enumerate(A):
        if i - a in count:
            ans += count[i-a]
        count[i+a] += 1
    print(ans)
 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from fractions import gcd

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

K = int(read())
ans = 0

for a in range(K):
    for b in range(K):
        for c in range(K):
            ans += gcd(a+1,gcd(b+1,c+1))

print(ans)

Fixed submission:
import sys
from fractions import gcd

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

K = int(read())
ans = 0

gcd_list = [[0]*210 for i in range(210)]
num_ct = [0]*210

for a in range(K):
    for b in range(K):
        tmp = gcd(a+1,b+1)
        gcd_list[a+1][b+1] = tmp
        num_ct[tmp] += 1

for c in range(K):
    for tmp in range(K):
        ans += gcd_list[c+1][tmp+1] * num_ct[tmp+1]

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
from math import factorial

def comb(n,r):
    a = factorial(n) / factorial(r) / factorial(n - r)
    return int(a)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


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

ans = comb(N, 2) + comb(M, 2)

print(ans)

Fixed submission:
import sys
from math import factorial

def comb(n,r):
    a = factorial(n) / factorial(r) / factorial(n - r)
    return int(a)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


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

a = comb(N, 2) if N>=2 else 0
b = comb(M, 2) if M >=2 else 0
ans = N * (N-1) // 2 + M * (M-1) //2
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

def lcm(x,y):
    return int((x*y-(x * y)%math.gcd(x, y))/math.gcd(x,y))

C_comp = int((B-(B%C))/C) - int(((A-1)-(A-1)%C)/C)
D_comp = int((B-(B%D))/D) - int(((A-1)-(A-1)%D)/D)
CD_comp = int((B-(B%lcm(C,D)))/lcm(C,D)) - int(((A-1)-(A-1)%lcm(C,D))/lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))


Fixed submission:
import fractions
A, B, C, D = map(int, input().split())

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

C_comp = (B//C) - ((A-1)//C)
D_comp = (B//D) - ((A-1)//D)
CD_comp = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))

Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

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

C_comp = (B//C) - ((A-1)//C)
D_comp = (B//D) - ((A-1)//D)
CD_comp = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))


Fixed submission:
import fractions
A, B, C, D = map(int, input().split())

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

C_comp = (B//C) - ((A-1)//C)
D_comp = (B//D) - ((A-1)//D)
CD_comp = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))

Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

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

C_comp = B//C - (A-1)//C
D_comp = B//D - (A-1)//D
CD_comp = B//lcm(C,D) - (A-1)//lcm(C,D)

print((B - A + 1) - (C_comp + D_comp - CD_comp))


Fixed submission:
import fractions
A, B, C, D = map(int, input().split())

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

C_comp = (B//C) - ((A-1)//C)
D_comp = (B//D) - ((A-1)//D)
CD_comp = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))

Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

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

C_comp = B // C - (A-1) // C
D_comp = B // D - (A-1) // D
CD_comp = B // lcm(C,D) - (A-1) // lcm(C,D)

print((B - A + 1) - (C_comp + D_comp - CD_comp))


Fixed submission:
import fractions
A, B, C, D = map(int, input().split())

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

C_comp = (B//C) - ((A-1)//C)
D_comp = (B//D) - ((A-1)//D)
CD_comp = (B//lcm(C,D)) - ((A-1)//lcm(C,D))

print((B - A + 1) - (C_comp + D_comp - CD_comp))
Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
co = [list(map(int, input().split())) for i in range(N)]

tmp = []
for i in range(N):
    for j in range(N):
        tmp.append((co[i][0]-co[j][0],co[i][1]-co[j][1]))
c = collections.Counter(tmp)
print(N - c.most_common()[1][1])

Fixed submission:
import collections

N = int(input())
co = [list(map(int, input().split())) for i in range(N)]

if N > 1:
    tmp = []
    for i in range(N):
        for j in range(N):
            tmp.append((co[i][0]-co[j][0],co[i][1]-co[j][1]))
    c = collections.Counter(tmp)
    print(N - c.most_common()[1][1])
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A.sort()
M = 0
for i in range(N-1):
    M += abs(A[i])
M += A[N-1]
print(M)

nminus = len([i for i in A if i < 0])
nplus = N - nminus

if nplus == 0:
    caled = A[N]
    for i in range(N-1):
        print(caled,A[i])
        caled -= A[i]
elif nminus == 0:
    caled = A[0]
    for i in range(N-2):
        print(caled, A[i+1])
        caled -= A[i+1]
    print(A[N-1],caled)
else:
    caled = A[0]
    for i in range(nplus-1):
        print(caled,A[nminus+i])
        caled -= A[nminus+i]
    caled_2 = A[N-1]
    for i in range(nminus-1):
        print(caled_2,A[i+1])
    print(caled_2,caled)

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int, input().split()))

A.sort()

nminus = len([i for i in A if i < 0])
nplus = N - nminus



if nminus == N:
    M = 2*A[N-1] - np.sum(A)
    print(M)

    caled = A[N-1]
    for i in range(nminus-1):
        print(caled,A[i])
        caled -= A[i]
elif nplus == N:
    M = np.sum(A) - 2*A[0]
    print(M)

    caled = A[0]
    for i in range(N-2):
        print(caled, A[i+1])
        caled -= A[i+1]
    print(A[N-1],caled)
else:
    M = 0
    for i in range(N-1):
        M += abs(A[i])
    M += A[N-1]
    print(M)

    caled = A[0]
    for i in range(nplus-1):
        print(caled,A[nminus+i])
        caled -= A[nminus+i]
    caled_2 = A[N-1]
    for i in range(nminus-1):
        print(caled_2,A[i+1])
        caled_2 -= A[i+1]
    print(caled_2,caled)
Buggy python submission (verdict: Runtime Error):
N,P = map(int, input().split())

i = 1
ans = 1
if N > 1:
	while P >= i**N:
		if P % i**N == 0:
			ans = i
		i += 1
else:
	ans = P
print(ans)



Fixed submission:
N = input()
ans = 0
for i in range(4):
	if N[i] == '2':
		ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,P = map(int, input().split())

i = 1
ans = 1
R = int(P**(1/N)) + 1
if N > 1:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
		i += 1
else:
	ans = P
print(ans)



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

ans = 1
R = int(P**(1/N)) + 1
if N == 1:
	ans = P
elif N > 40:
	ans = 1
else:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,P = map(int, input().split())

i = 1
ans = 1
R = int(P**(1/N)) + 1
if N > 2:
	for l in range(R): 
		if P % i**N == 0:
			ans = i
		i += 1
elif N == 2:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
		i += 1
else:
	ans = P
print(ans)


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

ans = 1
R = int(P**(1/N)) + 1
if N == 1:
	ans = P
elif N > 40:
	ans = 1
else:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,P = map(int, input().split())

i = 1
ans = 1
R = int(P**(1/N)) + 1
if N > 1:
	for l in range(R): 
		if P % i**N == 0:
			ans = i
		i += 1
else:
	ans = P
print(ans)


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

ans = 1
R = int(P**(1/N)) + 1
if N == 1:
	ans = P
elif N > 40:
	ans = 1
else:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,P = map(int, input().split())

i = 1
ans = 1
if N > 1:
	while P >= i**N:
		if P % i**N == 0:
			ans = i
		i += 1
else:
	ans = P
print(ans)



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

ans = 1
R = int(P**(1/N)) + 1
if N == 1:
	ans = P
elif N > 40:
	ans = 1
else:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,P = map(int, input().split())

i = 1
ans = 1
while P >= i**N:
	if P % i**N == 0:
		ans = i
	i += 1
print(ans)



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

ans = 1
R = int(P**(1/N)) + 1
if N == 1:
	ans = P
elif N > 40:
	ans = 1
else:
	for l in range(R):
		if P % (R-l)**N == 0:
			ans = R-l
			break
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input(),split())
if A!=2 and B!=2:
  print('Yes')
else:
  print('No')

Fixed submission:
A,B = map(int, input().split())
if A == 2 or B == 2:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

N,X = map(int, input().split())
x = list(map(int, input().split()))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

for i in range(len(x)):
    x[i] = abs(x[i]-X)

print(gcd_list(x))



Fixed submission:
import math
from functools import reduce
import fractions

N,X = map(int, input().split())
x = list(map(int, input().split()))

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

for i in range(len(x)):
    x[i] = abs(x[i]-X)

print(gcd_list(x))
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())

i = 0
counter = 0
while counter < K:
	counter += int(S[i])**5e15
	i += 1
print(S[i])

Fixed submission:
S = input()
K = int(input())

a = 1
for i in range(K):
	if int(S[i]) != 1:
		print(int(S[i]))
		a = 0
		break
if a == 1:
	print(a)
Buggy python submission (verdict: Runtime Error):
N,K = map(str, input().split())
if N % K != 0:
  print(1)
else:
  print(0)

Fixed submission:
N,K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)

Buggy python submission (verdict: Runtime Error):
N,K = list(map(str, input().split()))
if N % K != 0:
  print(1)
else:
  print(0)

Fixed submission:
N,K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if X - A <= C:
	print('YES')
else:
	print('NO')
	

Fixed submission:
A, B, X = map(int, input().split())
if A+B >= X and X >= A:
	print('YES')
else:
	print('NO')
Buggy python submission (verdict: Runtime Error):
S = input()
if S == abc or S == acb or S == bac or S ==bca or S == cab or S == cba:
	print('Yes')
else:
	print('No')
	

Fixed submission:
S = input()
if S == 'abc' or S == 'acb' or S == 'bac' or S =='bca' or S == 'cab' or S == 'cba':
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
a, b, c = int(split.input())
if a == c or b == c or a + b == c:
	print('Yes')
else:
	print('No')


Fixed submission:
a, b, c = map(int,input().split())
if a + b >= c:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

print(a[0] + b[1] + c[2])


Fixed submission:
a, b, c = map(int,input().split())
if a + b >= c:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

if N % 500 < A:
	print('Yes')
else:
	print('No')

Fixed submission:
N =int(input())
A = int(input())

if N % 500 <= A:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
x = int(input())
A = int(input())
B = int(input()9

print((x - A) % B)


Fixed submission:
x = int(input())
A = int(input())
B = int(input())

print((x - A) % B)

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

print((x - A) % B)


Fixed submission:
x = int(input())
A = int(input())
B = int(input())

print((x - A) % B)
Buggy python submission (verdict: Runtime Error):
S  = input()
S[3] = '8'
print(S)

Fixed submission:
S  = list(input())
S[3] = '8'
s = "".join(S)
print(s)
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
print(math.ceil((n[0] + n[1])/2))


Fixed submission:
import math
n = list(map(int, input().split()))
print(math.ceil((n[0] + n[1])/2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().strip().split()))
a.sort()

i = 0
j = 1
ans = 0

for i in range(N-1):
	if a[i] == a[i+1]:
		j += 1
	else:
		if j >= a[i]:
			ans += j - a[i]
		else:
			ans += j
if a[N-1] != A[N-2]:
	if a[N-1] != 1:
		ans += 1
else:
	if j >= a[i]:
		ans += j - a[i]
	else:
		ans += j


Fixed submission:
N = int(input())
a = list(map(int, input().strip().split()))
a.sort()
i = 0
j = 1
ans = 0

for i in range(N-1):
	if a[i] == a[i+1]:
		j += 1
	else:
		if j >= a[i]:
			ans += j - a[i]
		else:
			ans += j
		j = 1
if a[N-1] != a[N-2]:
	if a[N-1] != 1:
		ans += 1
else:
	if j >= a[i]:
		ans += j - a[i]
	else:
		ans += j
print(ans)
Buggy python submission (verdict: Runtime Error):
A = input()
print(int(A[0])+int(A[1]+int(A[2]))

Fixed submission:
A = input()
print(int(A[0])+int(A[1])+int(A[2]))
Buggy python submission (verdict: Runtime Error):
A = int(input())
G = int(input())
 
if A[0]+A[1]+A[2] ==G[2]+G[1]+G[0]:
	print('YES')
else:
	print('NO')

Fixed submission:
A = input()
G = input()
 
if A[0]+A[1]+A[2] ==G[2]+G[1]+G[0]:
	print('YES')
else:
	print('NO')
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
 
if a==b:
	print(c)
if a==c:
	print(b)
else:
	print(a)
a,b,c = map(int, input().split())

if a==b:
	print(c)
elif a==c:
	print(b)
else:
	print(a)


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

if a==b:
	print(c)
elif a==c:
	print(b)
else:
	print(a)

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

if a=b:
	print(c)
if a=c:
	print(b)
else:
	print(a)

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

if a==b:
	print(c)
elif a==c:
	print(b)
else:
	print(a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
M = N[2] + N[1] + N[0]
if N == M:
	print('Yes')
else:
	print('No')

Fixed submission:
N = input()
M = N[2] + N[1] + N[0]
if N == M:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
N = input()
M = N[2] + N[1] + N[0]
if N == M:


Fixed submission:
N = input()
M = N[2] + N[1] + N[0]
if N == M:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum / gcd(prenum, T) * T
	prenum = lcm
print(str(lcm))

Fixed submission:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum // gcd(prenum, T) * T
	prenum = lcm
print(lcm)

Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = (prenum / gcd(prenum, T)) * T
	prenum = lcm
print(int(lcm))

Fixed submission:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum // gcd(prenum, T) * T
	prenum = lcm
print(lcm)

Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = (prenum / gcd(T, prenum)) * T
	prenum = lcm
print(int(lcm))

Fixed submission:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum // gcd(prenum, T) * T
	prenum = lcm
print(lcm)

Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 		
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = (prenum*T) / gcd(T, prenum)
	prenum = lcm
print(int(lcm))

Fixed submission:
def gcd(x, y):
	if x < y:
		x, y = y, x
	if y == 0:
		return x
	z = x % y
	return gcd(y, z) 
	
N=int(input())
prenum = 1
for i in range(N):
	T = int(input())
	lcm = prenum // gcd(prenum, T) * T
	prenum = lcm
print(lcm)
Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))
a = num[0]
b = num[1]
c = num[2]

if a%3 == 0 or b%3 == 0 or (a+b) %3 ==0 :
	print('Possible')
else:
	print('Impossible')
	

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

if a%3 == 0 or b%3 == 0 or (a+b) %3 ==0 :
	print('Possible')
else:
	print('Impossible')
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().strip().split()))
grid = []
k = 0
j = 0
for i in range(N):
	array = list(map(int, input().strip().split()))
	grid.append(array)
for i in range(N):
	if k < K:
		k += grid[i-1][1]
		j += 1
print(str(grid[j][0])[K-k])

Fixed submission:
num = list(map(int, input().split()))
if num[2] >= num[0] and num[2] <= num[1]:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().strip().split()))
grid = []
k = 0
j = 0
for i in range(N):
	array = list(map(int, input().strip().split()))
	grid.append(array)
for i in range(N):
	if k < K:
		k += grid[i-1][1]
		j += 1
print(str(grid[j][0])[K-k])

Fixed submission:
import numpy as np
N,K = map(int, input().split())
ab = [tuple(map(int, input().split())) for i in range(N)]
ab.sort()
num = 0
for i in range(N):
	num += ab[i][1]
	if num >= K:
		ans = ab[i][0]
		break

print(ans)
Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))
if(num[1]-num[0] = num[2]-num[1]):
    print('Yes')
else
    print('No')



Fixed submission:
num = list(map(int, input().split()))
if num[1]-num[0] == num[2]-num[1]:
	print('YES')
else:
	print('NO')

Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))
if(b-a = c-b):
print('Yes')

a = num[0] + num[1]
print(int(a/24))


Fixed submission:
num = list(map(int, input().split()))
if num[1]-num[0] == num[2]-num[1]:
	print('YES')
else:
	print('NO')