Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
for i in range(M//N, 0, -1):
	if M%i == 0:
		break
print(i)


Fixed submission:
N, M = map(int, input().split())
d = []
for i in range(1, int(M**0.5)+1):
	if M%i == 0:
		d.append(i)
		d.append(M//i)
d.sort()
for i in range(1,len(d)+1):
	if d[-i] <= M//N:
		print(d[-i])
		exit()

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
ans = 1
for i in range(M//N, 0, -1):
	if M%i == 0:
		ans = i
		break

print(ans)


Fixed submission:
N, M = map(int, input().split())
d = []
for i in range(1, int(M**0.5)+1):
	if M%i == 0:
		d.append(i)
		d.append(M//i)
d.sort()
for i in range(1,len(d)+1):
	if d[-i] <= M//N:
		print(d[-i])
		exit()

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
ans = 1
if N == 1:
	ans = M

else:
	for i in range(M//N, 0, -1):
		if M%i == 0:
			ans = i
			break

print(ans)


Fixed submission:
N, M = map(int, input().split())
d = []
for i in range(1, int(M**0.5)+1):
	if M%i == 0:
		d.append(i)
		d.append(M//i)
d.sort()
for i in range(1,len(d)+1):
	if d[-i] <= M//N:
		print(d[-i])
		exit()

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
ans = 1
if N == 1:
	ans = M

else:
	for i in range(int(M/N), 0, -1):
		if M%i == 0:
			ans = i
			break

print(ans)


Fixed submission:
N, M = map(int, input().split())
d = []
for i in range(1, int(M**0.5)+1):
	if M%i == 0:
		d.append(i)
		d.append(M//i)
d.sort()
for i in range(1,len(d)+1):
	if d[-i] <= M//N:
		print(d[-i])
		exit()

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
ans = 1
if N == 1:
	ans = M

else:
	for i in range(2,int(M/N)+1):
		if M%i == 0:
			ans = i
		else:
			pass
print(ans)


Fixed submission:
N, M = map(int, input().split())
d = []
for i in range(1, int(M**0.5)+1):
	if M%i == 0:
		d.append(i)
		d.append(M//i)
d.sort()
for i in range(1,len(d)+1):
	if d[-i] <= M//N:
		print(d[-i])
		exit()

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
ans = 1
for i in range(2,int(M/N)+1):
	if M%i == 0:
		ans = i
	else:
		pass
print(ans)


Fixed submission:
N, M = map(int, input().split())
d = []
for i in range(1, int(M**0.5)+1):
	if M%i == 0:
		d.append(i)
		d.append(M//i)
d.sort()
for i in range(1,len(d)+1):
	if d[-i] <= M//N:
		print(d[-i])
		exit()
Buggy python submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
  

Fixed submission:
n = input()
a,b,c = [int(n[i]) for i in range(len(n))]

if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
v = list(map(int, input().split()))

a = []
b = []
for i in range(n//2):
    a.append(v[2*i])
    b.append(v[2*i+1])

def change(list):
    counter = Counter(list)
    m_ap1, m_ap2 = counter.most_common()[0][0], counter.most_common()[1][0]
    l = len(list)
    cnt = 0
    for i in range(l):
        if list[i] != m_ap1:
            cnt1 += 1
        if list[i] != m_ap2:
            cnt2 += 1
    return cnt1, cnt2, m_ap1, m_ap2
ca1, ca2, ma1, ma2 = change(a)
cb1, cb2, mb1, mb2 = change(b)

if ca1+cb1:
    if ma1 != mb1:
        print(ca1+cb1)
    else:
        print(min(ca1+cb2,cb1+ca2))
else:
    print(n//2)


Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int, input().split()))

a = []
b = []
for i in range(n//2):
    a.append(v[2*i])
    b.append(v[2*i+1])

def change(list):
    counter = Counter(list)
    m_ap1 = '0'
    m_ap2 = '0'
    if len(counter.most_common()) > 1:
        m_ap1, m_ap2 = counter.most_common()[0][0], counter.most_common()[1][0]
    else:
        m_ap1 = counter.most_common()[0][0]
    l = len(list)
    cnt1 = 0
    cnt2 = 0
    for i in range(l):
        if list[i] != m_ap1:
            cnt1 += 1
        if list[i] != m_ap2:
            cnt2 += 1
    return cnt1, cnt2, m_ap1, m_ap2
ca1, ca2, ma1, ma2 = change(a)
cb1, cb2, mb1, mb2 = change(b)
# print(change(a))
# print(change(b))
if ca1+cb1:
    if ma1 != mb1:
        print(ca1+cb1)
    else:
        print(min(ca1+cb2,cb1+ca2))
else:
    if ma1 != mb1:
        print(ca1+cb1)
    else:
        print(n//2)
Buggy python submission (verdict: Runtime Error):
R = int(input(R))
if R < 1200:
  print('ABC')
elif 1200 <= R < 2800:
  print('ARC')
else:
  print('AGC')

Fixed submission:
R = int(input())
if R < 1200:
  print('ABC')
elif 1200 <= R < 2800:
  print('ARC')
else:
  print('AGC')
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
A = []
A.append(a)
A.append(b)
A.append(c)
A = A.sort()
sum = 0
for i in range(4):
	sum += int(A[i]) - int(A[i-1])
print(sum)

Fixed submission:
from sys import stdin
A = [int(x) for x in stdin.readline().rstrip().split()]

print(max(A)-min(A))

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

for i in range(1,N):
	sum += A[i]-A[i-1]
print(sum)

Fixed submission:
from sys import stdin
A = [int(x) for x in stdin.readline().rstrip().split()]

print(max(A)-min(A))
Buggy python submission (verdict: Runtime Error):
n, m ,d = map(int, input().split())
ans = 0for i in range(1,m):
if d == 0:
	ans = m/n
else:
	ans = m*2*(n-d)/n**2
print(ans)

Fixed submission:
n, m ,d = map(int, input().split())
ans = 0
if d == 0:
	ans = (m-1)/n
else:
	ans = (m-1)*2*(n-d)/n**2
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = input().split()
ans = 0
min = max(a)
for i in range(0,N):
	a[i] = int(a[i])
for i in range(0,N-1):
	for j in range(1,N):
		if abs(a[i]-a[j]) < min
			min = abs(a[i]-a[j])
print(min)

Fixed submission:
N = int(input())
a = input().split()


for i in range(0,N):
	a[i] = int(a[i])
mi = 0
for i in range(0,N-1):
	for j in range(i+1,N):
		if abs(a[i]-a[j]) > mi:
			mi = abs(a[i]-a[j])
print(mi)
Buggy python submission (verdict: Time Limit Exceeded):
import statistics
import math

N = int(input())
a = input().split()
ans = 0
for i in range(0,N):
	a[i] = int(a[i])-i
ave = sum(a)/len(a)
for i in range(0,N):
	ans += abs(a[i]-int(statistics.median(a)))
print(int(ans))

Fixed submission:
import statistics
import math

N = int(input())
a = input().split()
ans = 0
for i in range(0,N):
	a[i] = int(a[i])-i
med = int(statistics.median(a))
for i in range(0,N):
	ans += abs(a[i]-med)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
d = b - a

def memorize(f):
	table = []
	def func(*args):
		if not args in table:
			table[args] = f(*args)
		return table[args]
	return func

@memorize
def s(n):
	if n <= 1:
		return 1
	else:
		return s(n-1)+n
print(s(d-1)-a)

Fixed submission:
a, b = map(int, input().split())
d = b - a
print(int((d*(d+1)/2)-b))

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

def memorize(f):
	table = {}
	def func(*args):
		if not args in table:
			table[args] = f(*args)
		return table[args]
	return func

@memorize
def s(n):
	if n <= 1:
		return 1
	else:
		return s(n-1)+n
print(s(d-1)-a)

Fixed submission:
a, b = map(int, input().split())
d = b - a
print(int((d*(d+1)/2)-b))

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
d = b - a
def s(n):
	if n == 1:
		return 1
	else:
		return s(n-1)+n
print(s(d)-b)

Fixed submission:
a, b = map(int, input().split())
d = b - a
print(int((d*(d+1)/2)-b))
Buggy python submission (verdict: Runtime Error):
flag = 'False'
N = int(input())
c = raw_input().split()
for i in range(0,N):
  if c[i] == 'Y':
    flag = 'True'
if flag:
  print('Four')
else:
  print('Three')

Fixed submission:
flag = 0
N = int(input())
c = input().split()
for i in range(0,N):
  if c[i] == 'Y':
    flag = 1
if flag:
  print('Four')
else:
  print('Three')

Buggy python submission (verdict: Runtime Error):
N = int(input())
flag = 'False'
for i in range(0,N):
  c = input()
  if c == 'Y':
    flag = 'True'
if flag:
  print('Four')
else:
  print('Three')

Fixed submission:
flag = 0
N = int(input())
c = input().split()
for i in range(0,N):
  if c[i] == 'Y':
    flag = 1
if flag:
  print('Four')
else:
  print('Three')
Buggy python submission (verdict: Runtime Error):
s = input()
sum = 0
for i in range(0,len[s]):
	sum += int(s[i])
return(sum)


Fixed submission:
s = input()
ans = 0
for i in range(0,len(s)):
	if s[i]=='1':
		ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
sum = 0
for i in range(0,len[s]):
	sum += i
return(sum)

Fixed submission:
s = input()
ans = 0
for i in range(0,len(s)):
	if s[i]=='1':
		ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = input().split()
for i in range(0,N):
	a[i] = int(a[i])
a.sort()
t = 0
flag = 1
sum_a = 0
for i in range(0,N):
	sum_a += a[i]
	if sum_a*2 < a[i+1]:
		t = i+1
		flag = 0
	if flag == 0:
		break
			
print(N-t)

Fixed submission:
N = int(input())
a = input().split()
for i in range(0,N):
	a[i] = int(a[i])
a.sort()
t = 0
flag = 1
sum_a = 0
for i in range(0,N-1):
	sum_a += a[i]
	if sum_a*2 < a[i+1]:
		t = i+1

			
print(N-t)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
A.sort()

import math
ans=0
for i in range(n):
    check=True
    for k in range(i):
        if A[k]/2>(A[i]):
            break
        if A[i]%A[k]==0:
            check=False
            break
    if i!=n-1:
        if A[i]==A[i+1]:
            check=False
    if check:
        ans+=1


print(ans)



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

box=[True]*(A[-1]+1)

for i in range(len(A)):
    if i<n-1 and A[i]==A[i+1]:
        box[A[i]]=False
    k=2
    while A[i]*k<len(box):
        box[A[i]*k]=False
        k+=1

ans=0
for i in A:
    if box[i]:
        ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
A.sort()

ans=0
for i in range(n):
    check=True
    for j in range(i):
        if A[i]%A[j]==0:
            check=False
            break
    if i!=n-1:
        if A[i]==A[i+1]:
            check = False
    if check:
        ans+=1
print(ans)



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

box=[True]*(A[-1]+1)

for i in range(len(A)):
    if i<n-1 and A[i]==A[i+1]:
        box[A[i]]=False
    k=2
    while A[i]*k<len(box):
        box[A[i]*k]=False
        k+=1

ans=0
for i in A:
    if box[i]:
        ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))

ans=1
for i in A:
    ans*=i
if ans>10**18:
    print(-1)
else:
    print(ans)

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

import sys
ans = 1
for i in range(n):
    ans *= A[i]
    if ans > 10 ** 18:
        for j in range(i,n):
            if A[j]==0:
                print(0)
                sys.exit()
        ans=-1
        break

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

nissuu=sum(A)

if nissuu>N:
    print(-1)
else:
    print(N-nissuu)

Fixed submission:
from math import pi

R=int(input())

print(2*pi*R)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N=int(input())
S=[0]*5000
S=list(input())

S_count=Counter(S)
r=S_count["R"]
g=S_count["G"]
b=S_count["B"]

ans=0

for i in range(N-2):
    for j in range(1,N):
        if i+2*j>=N:
            break
        if S[i]!=S[i+j] and S[i+j]!=S[i+2*j] and S[i]!=S[i+2*j]:
            ans+=1

print(r*g*b-ans)

Fixed submission:
import sys
K=str(input())
K=list(K) #いらないかも
K=[int(i) for i in K]

for i in K:
    if i==7:
        print("Yes")
        sys.exit()
print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

Fixed submission:
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

K=int(input())
ans=0
for a in range(1,K+1):
    for b in range(1, K + 1):
        for c in range(1,K+1):
            ans+=gcd(a,b,c)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
S=[0]*5000
S=list(input())

S_count=Counter(S)
r=S_count["R"]
g=S_count["G"]
b=S_count["B"]

ans=0

for i in range(N-2):
    for j in range(1,N):
        if i+2*j>=N:
            continue
        if S[i]!=S[i+j] and S[i+j]!=S[i+2*j] and S[i]!=S[i+2*j]:
            ans+=1

print(r*g*b-ans)

Fixed submission:
from collections import Counter
N=int(input())
S=[0]*5000
S=list(input())

S_count=Counter(S)
r=S_count["R"]
g=S_count["G"]
b=S_count["B"]

ans=0

for i in range(N-2):
    for j in range(1,N):
        if i+2*j>=N:
            break
        if S[i]!=S[i+j] and S[i+j]!=S[i+2*j] and S[i]!=S[i+2*j]:
            ans+=1

print(r*g*b-ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())

for i in range(18):
    if N > 10 ** i * K:
        for j in range(999):
            if N > j*10 ** i * K:
                N=N-j*10 ** i * K


while abs(N-K)<N:
    N=abs(N-K)

print(N)

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



for i in reversed(range(18)):
    while N > 10 ** i * K:
        N=N-10 ** i * K


while abs(N-K)<N:

    N=abs(N-K)

print(N)

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

if K==1:
    N=0

while abs(N-K)<N:
    N=abs(N-K)

print(N)


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



for i in reversed(range(18)):
    while N > 10 ** i * K:
        N=N-10 ** i * K


while abs(N-K)<N:

    N=abs(N-K)

print(N)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())


def calc(n):
    x = str(n)
    x = [int(i) for i in x]

    if len(x)==1:
        return True
    for i in range(len(x)-1):
        if abs(x[i] - x[i + 1]) > 1:
            return False
    return True

i=1
t=[]
while True:
    if calc(i):
        t.append(i)
    i+=1
    if len(t)==K:
        break
print(t[-1])

Fixed submission:
K=int(input())
ans=[]
for i in range(1,10):
    ans.append(i)
i=0

while True:
    if ans[i]%10==0:
        ans.append(10*ans[i])
        ans.append(10*ans[i]+1)
    elif ans[i]%10==9:
        ans.append(10*ans[i]+8)
        ans.append(10*ans[i]+9)
    else:
        ans.append(10*ans[i]+(ans[i]%10-1))
        ans.append(10 * ans[i] + (ans[i] % 10 ))
        ans.append(10 * ans[i] + (ans[i] % 10+1))
    if len(ans)>K:
        break
    i+=1

print(ans[K-1])
Buggy python submission (verdict: Runtime Error):
N,X,Y=map(int,input().split())


def count(k):
    count=0
    for i in range(1,N):
        for j in range(i+1,N+1):
            if min(abs(j-i),abs(X-i)+abs(Y-j)+1)==k:
                count+=1
                if count >= 4:
                    break
    return count

for k in range(1,N):
    print(count(k))

Fixed submission:
S=list(input())

if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,X,Y=map(int,input().split())

def count(k):
    ans=0
    for i in range(1,N):
        for j in range(i+1,N+1):
            if min(abs(j-i),abs(X-i)+abs(Y-j)+1)==k:
                ans+=1
    return ans

for k in range(1,N):
    print(count(k))


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

ans=[0]*N

for i in range(1,N):
    for j in range(i+1,N+1):
        ans[min(abs(j-i),abs(X-i)+abs(Y-j)+1)]+=1

for i in range(1,N):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
from collections import Counter
from operator import mul
from functools import reduce

def combinations_count2(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom
#
N=int(input())
A=list(map(int,input().split()))
#
hoge=Counter(A)
ans1=0
for i in hoge.values():
    if i==1:
        continue
    else:
        ans1+=combinations_count2(i,2)

ans2=[]
for i in A:
    ans2.append(A.count(i)-1)

for k in range(N):
    print(ans1-ans2[k])

Fixed submission:
import math
N,M=map(int,input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

x=0
y=0
if N>=2:
    x=combinations_count(N, 2)
if M>=2:
    y=combinations_count(M, 2)

print(x+y)
Buggy python submission (verdict: Runtime Error):
N,R=map(int,input().split())

if N>=10:
    print(R)
else:
    print(100*(10-K))

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):
#
N=int(input())
S=[]
for i in range(N):
    S.append(input())
ans=[]

#
while len(S):
    if len(S)==1:
        x = [S.pop(-1), 1]
        ans.append(x)
        break
    x = [S.pop(-1), 1]
    for i in S[:]:
        if x[0] == i:
            S.remove(i)
            x[1]+=1
    ans.append(x)
ans.sort()
ans.sort(key=lambda x:x[1],reverse=True)

for i in range(len(ans)):
    t=ans[0][1]
    if ans[i][1]==t:
        print(ans[i][0])


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

if (A is B and B is C) or (A is not B and B is not C and C is not A):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import math

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


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

print(lcm(A,B))

Fixed submission:
import fractions

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


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

print(lcm(A,B))

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


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

print(lcm(A,B))

Fixed submission:
import fractions

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


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

print(lcm(A,B))

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


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

print(lcm(A,B))

Fixed submission:
import fractions

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


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

print(lcm(A,B))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[]
g=[[-1]*(N) for i in range(N)]#g[i][j]はi番目からのj番目に対する証言

for i in range(N):
    a=int(input())
    A.append(a)
    for j in range(a):
        x,y=map(int,input().split())
        x-=1
        g[i][x]=y
num=[]
for i in range(2 **N):
  chars = list(f"{i:0{N}b}")
  chars=list(map(int,chars))
  num.append(chars)


ans=[]
for x in num:
    ok = True
    for k in range(N):#k番目の人
        if x[k]:
            for j in range(N):
                if g[k][j]==-1:
                    continue
                elif g[k][j]!=x[j]:
                    ok=False
    if ok:
        ans.append(x.count(1))
print(max(ans))

Fixed submission:
N=int(input())
A=[]
g=[[-1]*(N) for i in range(N)]#g[i][j]はi番目からのj番目に対する証言

for i in range(N):
    a=int(input())
    A.append(a)
    for j in range(a):
        x,y=map(int,input().split())
        x-=1
        g[i][x]=y
""""
num=[]
for i in range(2 **N):
  chars = list(f"{i:0{N}b}")
  chars=list(map(int,chars))
  num.append(chars)
"""
num=[]
for i in range(2**N):
    x=[]
    for j in range(N):
        if i>>j & 1:
            x.append(1)
        else:
            x.append(0)
    num.append(x)

ans=[]
for x in num:
    ok = True
    for k in range(N):#k番目の人
        if x[k]:
            for j in range(N):
                if g[k][j]==-1:
                    continue
                elif g[k][j]!=x[j]:
                    ok=False
    if ok:
        ans.append(x.count(1))
print(max(ans))
Buggy python submission (verdict: Runtime Error):
a = input()
b = a.split(" ")
for i in len(b):
  if b[i] == "0":
    print(i+1)
    break


Fixed submission:
a = input()
b = a.split(" ")
for i in range(len(b)):
    if b[i] == "0":
        print(i + 1)
        break
Buggy python submission (verdict: Runtime Error):
a = input()

t, c = int(a.split(" ")[0]), int(a.split(" ")[1])

if not c:
    print(t)

b = input()
lst = [int(x) for x in b.split(" ")]

for i in range(c):
    if t - i not in lst:
        print(t - i)
        break
    if t + i not in lst:
        print(t + i)
        break


Fixed submission:
a = input()

t, c = int(a.split(" ")[0]), int(a.split(" ")[1])

if not c:
    print(t)
else:
    b = input()
    lst = [int(x) for x in b.split(" ")]

    for i in range(c+2):
        if t - i not in lst:
            print(t - i)
            break
        if t + i not in lst:
            print(t + i)
            break

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
t = int(a.split(" ")[0])
lst = [int(x) for x in b.split(" ")]
x = len(lst)
if not x:
    print(t)
for i in range(x):
    if t - i not in lst:
        print(t - i)
        break
    if t + i not in lst:
        print(t + i)
        break


Fixed submission:
a = input()

t, c = int(a.split(" ")[0]), int(a.split(" ")[1])

if not c:
    print(t)
else:
    b = input()
    lst = [int(x) for x in b.split(" ")]

    for i in range(c+2):
        if t - i not in lst:
            print(t - i)
            break
        if t + i not in lst:
            print(t + i)
            break

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
t = int(a.split(" ")[0])
lst = [int(x) for x in b.split(" ")]
x = len(lst)
if not x:
  print(t)
for i in range(x):
  if t - x not in lst:
    print(t - x)
    break
  if t + x not in lst:
    print(t + x)
    break


Fixed submission:
a = input()

t, c = int(a.split(" ")[0]), int(a.split(" ")[1])

if not c:
    print(t)
else:
    b = input()
    lst = [int(x) for x in b.split(" ")]

    for i in range(c+2):
        if t - i not in lst:
            print(t - i)
            break
        if t + i not in lst:
            print(t + i)
            break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))

ans = 1

p = 10 ** 18

flg = False
flg_2 = False

for a in A_list:
    ans *= a

if ans > p:
    ans = -1


print(ans)



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

ans = 1

p = 10 ** 18

for a in A_list:
    ans *= a
    if ans > p:
        ans = -1
        break

if 0 in A_list:
    print(0)
else:
    print(ans)