Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,y = map(int,input().split())

for i in range(y//10000+1):
    if i > n:
        break
    for j in range((y-i*10000)//5000+1):
        if i + j > n:
            break
        for k in range((y-i*10000-j*5000)//1000+1):
            if i + j + k > n:
                break
            if i+j+k == n and i * 10000 + j * 5000 + k * 1000 == y:
                print(i,j,k)
                exit()

print(-1,-1,-1)


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

for i in range(y//10000+1):
    if i > n:
        break
    for j in range((y-i*10000)//5000+1):
        if i + j > n:
            break
        if i * 10000 + j * 5000 + (n-i-j) * 1000 == y:
            print(i,j,n-i-j)
            exit()

print(-1,-1,-1)

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

for i in range(y//10000+1):
    for j in range((y-i*10000)//5000+1):
        for k in range((y-i*10000-j*5000)//1000+1):
            if i+j+k == n and i * 10000 + j * 5000 + k * 1000 == y:
                print(i,j,k)
                exit()

print(-1,-1,-1)


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

for i in range(y//10000+1):
    if i > n:
        break
    for j in range((y-i*10000)//5000+1):
        if i + j > n:
            break
        if i * 10000 + j * 5000 + (n-i-j) * 1000 == y:
            print(i,j,n-i-j)
            exit()

print(-1,-1,-1)

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

for i in range(n+1):
    for j in range(2000-i+1):
        for k in range(2000-i-j+1):
            if i+j+k == n and i*10000 + j * 5000 + k * 1000 == y:
                print(i,j,k)
                exit()

print(-1,-1,-1)



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

for i in range(y//10000+1):
    if i > n:
        break
    for j in range((y-i*10000)//5000+1):
        if i + j > n:
            break
        if i * 10000 + j * 5000 + (n-i-j) * 1000 == y:
            print(i,j,n-i-j)
            exit()

print(-1,-1,-1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
xy = [list(map(int,input().split())) for _ in range(n)]

ans = 10 ** 20

for i in range(n):
    for j in range(i+1, n):
        for ii in range(n):
            for jj in range(ii+1, n):
                l = min(xy[i][0], xy[j][0])
                r = max(xy[i][0], xy[j][0])
                d = min(xy[ii][1], xy[jj][1])
                u = max(xy[ii][1], xy[jj][1])
                cnt = 0
                for x,y in xy:
                    if l <= x <= r and d <= y <= u:
                        cnt += 1
                if cnt >= k:
                    ans = min(ans, (r-l) * (u - d))

print(ans)


Fixed submission:
n,k = map(int,input().split())
xy = [list(map(int,input().split())) for _ in range(n)]

xy.sort()
ans = 10**20

for i in range(n):
    for j in range(i,n):
        xy_tmp = xy[i:j+1]
        if len(xy_tmp) >= k:
            l1 = xy_tmp[0][0]
            r1 = xy_tmp[-1][0]
            xy_tmp.sort(key = lambda x: x[1])
            for jj in range(len(xy_tmp) - k + 1):
                ans = min(ans, (r1-l1) * (xy_tmp[k+jj-1][1] - xy_tmp[jj][1]))

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

for h in range(1,3501):
    for w in range(1,3501):
        if 4 * h * w - n * w - n * h != 0:
            N = (n * h * w) / (4 * h * w - n * w - n * h)
            if N.is_integer() and N > 0:
                print(h,w,int(N))
                exit()


Fixed submission:
n = int(input())

for h in range(1,3501):
    for w in range(1,3501):
        if 4 * h * w - n * w - n * h != 0:
            N = (n * h * w) / (4 * h * w - n * w - n * h)
            if N.is_integer() and N > 0:
                print(h,w,int(N))
                exit()
Buggy python submission (verdict: Time Limit Exceeded):
h,w = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))

c = [[0] * w for _ in range(h)]
li = [[0,0]]
hw = [0,0]
dir = 'r'

while len(li) < h*w:
    if dir == 'r':
        if hw[1] < h-1:
            if [hw[0], hw[1]+1] not in li:
                hw[1] += 1
            else:
                dir = 'd'
        else:
            dir = 'd'
    elif dir == 'd':
        if hw[0] < w-1:
            if [hw[0]+1, hw[1]] not in li:
                hw[0] += 1
            else:
                dir = 'l'
        else:
            dir = 'l'
    elif dir == 'l':
        if hw[1] > 0:
            if [hw[0], hw[1]-1] not in li:
                hw[1] -= 1
            else:
                dir = 'u'
        else:
            dir = 'u'
    else:
        if hw[0] > 0:
            if [hw[0]-1, hw[1]] not in li:
                hw[0] -= 1
            else:
                dir = 'r'
        else:
            dir = 'r'
    if hw not in li:
        li.append([hw[0], hw[1]])

count = 0

for i in range(n):
    for _ in range(a[i]):
        c[li[count][1]][li[count][0]] = i+1
        count += 1

for i in range(h):
    for j in range(w):
        print(c[i][j],end = ' ')
    print()


Fixed submission:
h,w = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))

c = [[0] * w for _ in range(h)]
li = [[0,0]]
hw = [0,0]
dir = 'r'

while len(li) < h*w:
    if dir == 'r':
        if hw[1] < h-1:
            if [hw[0], hw[1]+1] not in li:
                hw[1] += 1
                li.append([hw[0], hw[1]])
            else:
                dir = 'd'
        else:
            dir = 'd'
    elif dir == 'd':
        if hw[0] < w-1:
            if [hw[0]+1, hw[1]] not in li:
                hw[0] += 1
                li.append([hw[0], hw[1]])
            else:
                dir = 'l'
        else:
            dir = 'l'
    elif dir == 'l':
        if hw[1] > 0:
            if [hw[0], hw[1]-1] not in li:
                hw[1] -= 1
                li.append([hw[0], hw[1]])
            else:
                dir = 'u'
        else:
            dir = 'u'
    else:
        if hw[0] > 0:
            if [hw[0]-1, hw[1]] not in li:
                hw[0] -= 1
                li.append([hw[0], hw[1]])
            else:
                dir = 'r'
        else:
            dir = 'r'

count = 0

for i in range(n):
    for _ in range(a[i]):
        c[li[count][1]][li[count][0]] = i+1
        count += 1

for i in range(h):
    for j in range(w):
        print(c[i][j],end = ' ')
    print()
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))

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

gcd1 = gcd(a[0], a[1])

for i in range(2,n):
    gcd1 = gcd(gcd1,a[i])

if k > max(a):
    print('IMPOSSIBLE')
else:
    if k % gcd1 == 0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')


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

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

if n == 1:
    gcd1 = a[0]
else:
    gcd1 = gcd(a[0], a[1])

    for i in range(2,n):
        gcd1 = gcd(gcd1,a[i])

if k > max(a):
    print('IMPOSSIBLE')
else:
    if k % gcd1 == 0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
result = 0
if K > 0 :
    result = result + A
    K = K - A
for i in range (K):
    if B > 0 :
        B = B-1
    else:
        result = result-1
print(result)

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

Buggy python submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
i = 0
result = 0
K = K - A
result = result + A
while K > i :
    if B > 0 :
        K = K- B
        B = B -B
    elif C > 0 :
        result = result - 1
        K = K - 1
print(result)

Fixed submission:
S = str(input())
T = str(input())
if T[:-1] == S :
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result

Fixed submission:
K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result)
Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())
r = X
X = Y
Y = r
r = X
X = Z
Z = r
print(X,Y,Z)

Fixed submission:
a,b,c = input().split()
print(c,a,b)
Buggy python submission (verdict: Runtime Error):
a,p=map(int,input().split())
c=(a*3)+p
pi=c//2
print(c+pi+"¥n")

Fixed submission:
a,p=map(int,input().split())
c=(a*3)+p
pi=c//2
print(str(pi)+'\n')

Buggy python submission (verdict: Runtime Error):
def pi(a,p):
  c=0
  pi=0
  while c>2:
    c=a*3+p
    pi=c//2
    
   return pi

Fixed submission:
a,p=map(int,input().split())
c=(a*3)+p
pi=c//2
print(str(pi)+'\n')
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s;
    cin >> s;
    if (s[s.size() - 1] == 's') {
        cout << s << "es";
    }
    else {
        cout << s << "s";
    }
    return 0;
}


Fixed submission:
s = input()
print(s+'es') if s.endswith('s') else print(s+'s')
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))
B-=1
print((A+B-1)/B)

Fixed submission:
A, B = list(map(int, input().split()))
for i in range(20):
    if B<=1+i*(A-1):
        print(i)
        break

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
B-=1
print((A+B-1)/B)

Fixed submission:
A, B = list(map(int, input().split()))
for i in range(20):
    if B<=1+i*(A-1):
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
s=I().strip()
arr=s.split("S")
ans=0
for i in arr:
    ans=max(ans,len(i))
print(ans)

Fixed submission:
import sys,math
from collections import deque,defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10**6) 

I=sys.stdin.readline

 #s="abcdefghijklmnopqrstuvwxyz"

#
def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))
def mi():
	return map(int,I().strip().split())

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x





	

def main():
	s=I().strip()
	arr=s.split("S")
	ans=0
	for i in arr:
		ans=max(ans,len(i))
	print(ans)

	













	
	
	






		







		
		
	
		

	







		









if __name__ == '__main__':
	main()

Buggy python submission (verdict: Runtime Error):
s=I().strip()
	arr=s.split("S")
	ans=0
	for i in arr:
		ans=max(ans,len(i))
	print(ans)

Fixed submission:
import sys,math
from collections import deque,defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10**6) 

I=sys.stdin.readline

 #s="abcdefghijklmnopqrstuvwxyz"

#
def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))
def mi():
	return map(int,I().strip().split())

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x





	

def main():
	s=I().strip()
	arr=s.split("S")
	ans=0
	for i in arr:
		ans=max(ans,len(i))
	print(ans)

	













	
	
	






		







		
		
	
		

	







		









if __name__ == '__main__':
	main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque,defaultdict

I=sys.stdin.readline

def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))

def mi():
	return map(int,I().strip().split())


def main():
	n,k=mi()
	arr=li()
	k_mul=1
	for i in range(k):
		k_mul*=arr[i]
	x=0
	for i in range(n-k):
		tmp=(k_mul//arr[x])*arr[k+i]
		if tmp>k_mul:
			print("Yes")
		else:
			print("No")
		k_mul=tmp
		x+=1








		


		










		






if __name__ == '__main__':
	main()

Fixed submission:
import sys
from collections import deque,defaultdict

I=sys.stdin.readline

def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))

def mi():
	return map(int,I().strip().split())


def main():
	ans=""
	n,k=mi()
	arr=li()
	a=0
	for i in range(n-k):
		tmp=arr[k+i]
		if tmp>arr[a]:
			ans+="Yes\n"
		else:
			ans+="No\n"
		a+=1
	print(ans)








		


		










		






if __name__ == '__main__':
	main()
Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())

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


a_pre,b_pre=[0],[0]

for i in range(n):
	a_pre.append(a_pre[i]+a[i])

for i in range(m):
	b_pre.append(b_pre[i]+b[i])

ans,j=0,m
for i in range(n+1):
	if a_pre[i]>k:
		break
	while b[j]>k-a[i]:
		j-=1

	ans=max(ans,i+j)

print(ans)


Fixed submission:
n,m,k=map(int,input().split())

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


a_pre,b_pre=[0],[0]

for i in range(n):
	a_pre.append(a_pre[i]+a[i])

for i in range(m):
	b_pre.append(b_pre[i]+b[i])

ans,j=0,m
for i in range(n+1):
	if a_pre[i]>k:
		break
	while b_pre[j]>k-a_pre[i]:
		j-=1

	ans=max(ans,i+j)

print(ans)

Buggy python submission (verdict: Runtime Error):
n,m,k=map(int,input().split())

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

if len(a)>len(b):
	a,b=b,a
i=0
j=0
total=0
cnt=0
while total<=k:
	if i<len(a):
		if a[i]<b[j]:
			total+=a[i]
			i+=1
		else:
			total+=b[j]
			j+=1
	elif j<len(b):
		total+=b[j]
		j+=1

	cnt+=1
	if total>k:
		cnt-=1
	if j==len(b) and i==len(a):
		break

print(cnt)




Fixed submission:
n,m,k=map(int,input().split())

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


a_pre,b_pre=[0],[0]

for i in range(n):
	a_pre.append(a_pre[i]+a[i])

for i in range(m):
	b_pre.append(b_pre[i]+b[i])

ans,j=0,m
for i in range(n+1):
	if a_pre[i]>k:
		break
	while b_pre[j]>k-a_pre[i]:
		j-=1

	ans=max(ans,i+j)

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

n=int(input())

arr=[0]*(n+1)

for i in range(1,n+1):
	for j in range(i,n+1,i):
		arr[j]+=1
	
ans=0
for i in range(1,n+1):
	ans+=(i)*arr[i]


print(ans)


Fixed submission:

n= int(input())
 
ans = 0
for i in range(1, n + 1):
    x = n // i
    ans += x * (x + 1) * i // 2
 
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=''
while n:
    n-=1
    s=chr(97+total%26)+s
    n//=26

print(s)

Fixed submission:
n=int(input())
s=''
while n:
    n-=1
    s=chr(97+n%26)+s
    n//=26

print(s)
Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())

sett=list(map(int,input().split()))
arr=[i for i in range(-1,102) if i not in sett]

min_=100000
num=0
for i in arr:
	if abs(x-i)<min_:
		min_=abs(x-i)
		num=i



print(num)


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

print(arr.index(0)+1)

Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
 
for i in range(x+1):
  if i*4+(x-i)*2==y:
    print("Yes")
    break   
else:
  print("No")

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

print(arr.index(0)+1)

Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
 
for i in range(x+1):
  if i*4+(x-i)*2==y:
    print("Yes")
    
else:
  print("No")

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

print(arr.index(0)+1)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())

for i in range(n+1):
  if i*4+(n-i)*2==y:
    print("Yes")
    
else:
  print("No")

Fixed submission:
x,y=map(int,input().split())
 
for i in range(x+1):
  if i*4+(x-i)*2==y:
    print("Yes")
    break   
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import sys

from collections import defaultdict

I=sys.stdin.readline

n=int(I())
arr=sorted(list(map(int,I().split())))
d=defaultdict(int)

for i in arr:
	d[i]+=1

ans=0
visited=[0]*(10**6+1)
for i in arr:
	if d[i]==1 and visited[i]==0:
		ans+=1

	for j in range(i,10**6+1,i):
		visited[j]=1

print(ans)


Fixed submission:
import sys

from collections import defaultdict

I=sys.stdin.readline

n=int(I())
arr=sorted(list(map(int,I().split())))
d=defaultdict(int)

for i in arr:
	d[i]+=1

ans=0
visited=[0]*(arr[-1]+1)
for i in arr:
	if d[i]==1 and visited[i]==0:
		ans+=1

	for j in range(i,arr[-1]+1,i):
		visited[j]=1

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

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

hour_angle=0.5*(60*h+m)
minute_angle=6*m

diff_angle=abs(hour_angle-minute_angle)

angle=min(360-diff_angle,diff_angle)
cos_angle=math.cos(angle*(math.pi/180))

lenth=math.sqrt(a**2+b**2-(2*a*b*cos_angle))
print(lenth)



Fixed submission:
n=int(input())
n=n%10

if n==3:
  print("bon")
elif n==0 or n==1 or n==6 or n==8:
  print("pon")
else:
  print("hon")
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
arr=list(map(int,input().split()))

for i in range(n-1):
	arr.append(arr[i]+k)

min_=99999999999

for i in range(n):
	if arr[i+n-1]-arr[i]<min_:
		min_=arr[i+n-1]-arr[i]


print(min_)

Fixed submission:
s=input()

if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:print("GREATER")
elif a<b:print("LESS")
else print("EQUAL")

Fixed submission:
a=int(input())
b=int(input())
if a>b:print("GREATER")
elif a<b:print("LESS")
else:print("EQUAL")
Buggy python submission (verdict: Runtime Error):
a,b,c,k = map(int,input().split())
if k < a:
  print(k)
elif a <= k and k < a+b:
  print(a)
else:
  print(a-(k-a-b))

Fixed submission:
s = input()
t = input()
if s == t[:-1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
if n % 2 == 1:
  print(0)
  quit()

l = int(math.log10(n))+1
cnt = 0
for i in range(1,10*l):
  cnt += (n // 5 ** i) // 2
print(cnt)


Fixed submission:
import math
n = int(input())
if n % 2 == 1:
  print(0)
  quit()
if n == 0:
  print(0)
  quit()

l = int(math.log10(n))+1
cnt = 0
for i in range(1,10*l):
  cnt += (n // 5 ** i) // 2
print(cnt)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, d = map(int, input().split())

p = np.zeros(n,d)

for i in range(n):
  p[i] = np.array(list(map(int, input().split())))

cnt = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    d = np.sqrt((p[i] - p[j]) ** 2)
    if d % 1 == 0:
      cnt += 1

print(cnt)


Fixed submission:
import numpy as np
 
n, d = map(int, input().split())
 
p = np.zeros((n,d))
 
for i in range(n):
  p[i] = np.array(list(map(int, input().split())))
cnt = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    d = np.sqrt(np.sum((p[i] - p[j]) ** 2))
    if d % 1 == 0:
      cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
p = input().split()

for i in range(3):
  if p[i] == p[i + 1]:
    print("Bad")
    quit()
print("Good")

Fixed submission:
p = input()

for i in range(3):
  if p[i] == p[i + 1]:
    print("Bad")
    quit()
print("Good")
Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
s = b - a + 1

def dev(x):
    if a % x == 0:
        return b // x - a // x + 1
    return b // x - a // x

print(s - (dev(c) + dev(d) - dev(c * d // math.gcd(c, d))))


Fixed submission:
from fractions import gcd
a, b, c, d = map(int, input().split())
s = b - a + 1

def dev(x):
    if a % x == 0:
        return b // x - a // x + 1
    return b // x - a // x

g = gcd(c, d)
print(s - (dev(c) + dev(d) - dev(c * d // g)))
Buggy python submission (verdict: Runtime Error):
str = input()

str_length = len(str)

import randum

start_num = randum.randint(0,str_length-3)

print(str[start_num:start_num+2])

Fixed submission:
str = input()
 
str_length = len(str)
 
import random
 
start_num = random.randint(0,str_length-3)
 
print(str[start_num:start_num+3])

Buggy python submission (verdict: Runtime Error):
print(S[0:2])

Fixed submission:
str = input()
 
str_length = len(str)
 
import random
 
start_num = random.randint(0,str_length-3)
 
print(str[start_num:start_num+3])
Buggy python submission (verdict: Runtime Error):

list=input().split()

num=int(list[0]+list[1])

num_squrt=math.sqrt(num)

if num_squrt.is_integer()==True:
    print("Yes")
else:
    print("No")

Fixed submission:
import math 

list=input().split()

num=int(list[0]+list[1])

num_squrt=math.sqrt(num)

if num_squrt.is_integer()==True:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
ans = sum(a[i] == b[i] for i in range(3))
print(ans)

Fixed submission:
a, b = map(int, input().split())
print((b-2) // (a - 1) + 1)
Buggy python submission (verdict: Runtime Error):
def actual(X, N, P):
    for i in range(X, -1, -1):
        if i not in P:
            left = i
            break

    for i in range(X, 101):
        if i not in P:
            right = i
            break

    if abs(left - X) <= abs(right - X):
        return left
    else:
        return right


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

if N == 0:
    print(X)
else:
    P = list(map(int, input().split()))
    print(actual(X, N, P))


Fixed submission:
def actual(X, N, P):
    for i in range(X, -1 - 1, -1):
        if i not in P:
            left = i
            break

    for i in range(X, 101 + 1):
        if i not in P:
            right = i
            break

    if abs(left - X) <= abs(right - X):
        answer = left
    else:
        answer = right

    return answer


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

if N == 0:
    P = []
    print(actual(X, N, P))
else:
    P = list(map(int, input().split()))
    print(actual(X, N, P))

Buggy python submission (verdict: Runtime Error):
def actual(X, N, P):
    for i in range(X, -1, -1):
        if i not in P:
            left = i
            break

    for i in range(X, 101):
        if i not in P:
            right = i
            break

    if abs(left - X) <= abs(right - X):
        return left
    else:
        return right


X, N = map(int, input().split())
P = input()

if P == '':
    print(X)
else:
    P = list(map(int, P.split()))
    print(actual(X, N, P))


Fixed submission:
def actual(X, N, P):
    for i in range(X, -1 - 1, -1):
        if i not in P:
            left = i
            break

    for i in range(X, 101 + 1):
        if i not in P:
            right = i
            break

    if abs(left - X) <= abs(right - X):
        answer = left
    else:
        answer = right

    return answer


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

if N == 0:
    P = []
    print(actual(X, N, P))
else:
    P = list(map(int, input().split()))
    print(actual(X, N, P))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()

part1 = s[:k - 1]
part2 = s[k - 1].lower()
part3 = s[k:]

print(f'{part1}{part2}{part3}')


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

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


def actual(a, b, c, k):
    if a >= k:
        return k
    else:
        k -= a

    if b >= k:
        return a
    else:
        k -= b

    return a - k


print(actual(a, b, c, k))


Fixed submission:
s = input()
t = input()

if s == t[:-1]:
	print('Yes')
else:
  	print('No')

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


def actual(a, b, c, k):
    if a >= k:
        return k
    else:
        k -= a

    if b >= k:
        return a
    else:
        k -= b

    return a - k

  
print(actual(a, b, c, k))  


Fixed submission:
s = input()
t = input()

if s == t[:-1]:
	print('Yes')
else:
  	print('No')

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

def actual(a, b, c, k):
    if a >= k:
        return k
    else:
        k -= a

    if b >= k:
        return a
    else:
        k -= b

    return a - k

  
print(actual(a, b, c, k))  

Fixed submission:
s = input()
t = input()

if s == t[:-1]:
	print('Yes')
else:
  	print('No')