Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
i=0
j=0
k=0
t=0
m=0
s=0
lists=[]
lists2 =[]

#数値の数を受け取る
line = int(input())

#数値を受け取ってリストの作成
while i < line:
	a = int(input())
	#print (a)
	lists.insert(i,a)
	i +=1

#数値の足し合わせ
while j < line:
    s += lists[j]
    j +=1

#正しければ出力
if s%10 != 0:
	print(s)
else:
    #10の倍数以外のリスト作成
    while k < line:
        if lists[k]%10 != 0:
	        lists2.insert(m,lists[k])
	        m +=1
        k +=1
    t = min(lists2)
    print(s-t)

Fixed submission:
import sys
i=0
j=0
k=0
t=0
m=0
s=0
lists=[]
lists2 =[]

#数値の数を受け取る
line = int(input())

#数値を受け取ってリストの作成
while i < line:
	a = int(input())
	#print (a)
	lists.insert(i,a)
	i +=1

#数値の足し合わせ
while j < line:
    s += lists[j]
    j +=1

#正しければ出力
if s%10 != 0:
	print(s)
else:
    #10の倍数以外のリスト作成
    while k < line:
        if lists[k]%10 != 0:
	        lists2.insert(m,lists[k])
	        m +=1
        k +=1
    if lists2 !=[]:
        t = min(lists2)
        print(s-t)
    else:
    	print(0)

Buggy python submission (verdict: Runtime Error):
import sys
i=0
j=0
k=0
t=0
m=0
s=0
lists=[]
lists2 =[]

#数値の数を受け取る
line = int(input())

#数値を受け取ってリストの作成
while i < line:
	a = int(input())
	#print (a)
	lists.insert(i,a)
	i +=1

#数値の足し合わせ
while j < line:
    s += lists[j]
    j +=1

#正しければ出力
if s%10 != 0:
	print(s)
else:
    #10の倍数以外のリスト作成
    while k < line:
        if lists[k]%10 != 0:
	        lists2.insert(m,lists[k])
	        m +=1
        k +=1
    t = min(lists2)
    print(s-t)

Fixed submission:
import sys
i=0
j=0
k=0
t=0
m=0
s=0
lists=[]
lists2 =[]

#数値の数を受け取る
line = int(input())

#数値を受け取ってリストの作成
while i < line:
	a = int(input())
	#print (a)
	lists.insert(i,a)
	i +=1

#数値の足し合わせ
while j < line:
    s += lists[j]
    j +=1

#正しければ出力
if s%10 != 0:
	print(s)
else:
    #10の倍数以外のリスト作成
    while k < line:
        if lists[k]%10 != 0:
	        lists2.insert(m,lists[k])
	        m +=1
        k +=1
    if lists2 !=[]:
        t = min(lists2)
        print(s-t)
    else:
    	print(0)
Buggy python submission (verdict: Runtime Error):
XKD=list(input().split(' '))
X=int(XKD[0])
K=int(XKD[1])
D=int(XKD[2])
AX=abs(X)

if AX>K*D:
    print(AX-K*D)
else:
    K2=AX//D
    if (K-K2)%2==0:
        P=AX-K2*D
    else:
        P=abs(AX-(K2+1)*D)
print(P)

Fixed submission:
XKD=list(input().split(' '))
X=int(XKD[0])
K=int(XKD[1])
D=int(XKD[2])
AX=abs(X)

if AX>K*D:
    print(AX-K*D)
else:
    K2=AX//D
    if (K-K2)%2==0:
        P=AX-K2*D
        print(P)
    else:
        P=abs(AX-(K2+1)*D)
        print(P)
Buggy python submission (verdict: Runtime Error):
temperature = int(input())

if 30 <= temperature:
    print('Yes')
els:
    print('No')


Fixed submission:
temperature = int(input())

if 30 <= temperature:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
m, k = map(int, input(.split()))
array = list(map(int, input().split()))

array.sort()
print(sum(array[:k]))


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

array.sort()
print(sum(array[:k]))
Buggy python submission (verdict: Runtime Error):
x, y = input().split()

for kame in range(0, x+1):
    tsuru = x - kame
    legs = kame * 4 + tsuru * 2
    if legs == y:
        print("Yes")
        break
else:
    print("No")


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

for kame in range(0, x+1):
    tsuru = x - kame
    legs = kame * 4 + tsuru * 2
    if legs == y:
        print("Yes")
        break
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
if k >= 1:
    print("OK")

if b - a + 2 >= k:
    print("OK")
else:
    print("NG")


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

a_div_k = a // k
b_div_k = b // k

a_mod_k = a % k
b_mod_k = b % k

if b < k:
    print("NG")
elif k == 1:
    print("OK")
elif k == b:
    print("OK")
elif (a_mod_k == 0) or (b_mod_k == 0) and (a_div_k == b_div_k):
    print("OK")
elif (k < a) and (a_div_k == b_div_k):
    print("NG")
else:
    print("OK")
Buggy python submission (verdict: Runtime Error):
heart_taka, power_taka, heart_aoki, power_aoki = map(int, input().split())

aliveTaka = True
aliveAoki = True
while (aliveTaka) or (aliveAoki):
    heart_aoki -= power_taka
    heart_taka -= power_aoki
    if heart_aoki <= 0:
        aliveAoki = False
    if heart_taka <= 0:
        aliveTaka = False

if aliveAoki == False:
    return "Yes"
return "No"

Fixed submission:
heart_taka, power_taka, heart_aoki, power_aoki = map(int, input().split())

aliveTaka = True
aliveAoki = True
while (aliveTaka) and (aliveAoki):
    heart_aoki -= power_taka
    heart_taka -= power_aoki
    if heart_aoki <= 0:
        aliveAoki = False
    if heart_taka <= 0:
        aliveTaka = False

if aliveAoki == False:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split(" "))
if abs(N)%K==0:
  print(1)
else:
  M=abs(N)%K
  S=abs(M-K)
print(min(M,S))

Fixed submission:
X,Y,Z=map(int,input().split(" "))
tmp=Y
Y=X
X=tmp
tmp=Z
Z=X
X=tmp
print(X,Y,Z,end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split(" "))

for i in range(N):
  if abs(N-K)<N:
    N=abs(N-K)
print(N)


Fixed submission:
N,K = map(int,input().split())
N = N % K
print (min(N,K-N))
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
c=0
if len(S)>2:
  for i in range(1,N):
    if S[i-1]=="A" and S[i]=="B" and S[i+1]=="C":
      c+=1
print(c)

Fixed submission:
N=int(input())
S=input()
c=0
if len(S)>2:
  for i in range(1,N-1):
    if S[i-1]=="A" and S[i]=="B" and S[i+1]=="C":
      c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N=int(input())
S=input()
c=0
for i in range(N):
  if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
    c+=1
print(c)

Fixed submission:
N=int(input())
S=input()
c=0
if len(S)>2:
  for i in range(1,N-1):
    if S[i-1]=="A" and S[i]=="B" and S[i+1]=="C":
      c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
c=0
for i in range(N):
  if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
    c+=1
print(c)

Fixed submission:
N=int(input())
S=input()
c=0
if len(S)>2:
  for i in range(1,N-1):
    if S[i-1]=="A" and S[i]=="B" and S[i+1]=="C":
      c+=1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N, X, Y = map(int, input().split(" "))

counts = [0 for i in range(N-1)]

distances = [[] for i in range(N-1)] 

for i in range(N):
    for j in range(i+1, N):
        dis = j-i
        if i <= X-1 :
            if j >= Y-1:
                dis -= Y-X-1
            elif j < Y-1:
                dis = min([j-i, (X-1)-i+1+abs(j-(Y-1))])             
        else:
            dis = min([j-i, i-(X-1)+1+abs(j-(Y-1))])
        
        distances[i].append(dis)
for i in range(N-1):
    for j in range(N-i-1):
        k = distances[i][j]-1
        counts[k] += 1
        
for k in range(N-1):
    print(counts[k])

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

counts = [0 for i in range(N-1)]

for i in range(N):
    for j in range(i+1, N):
        if i <= X-1 :
            if j >= Y-1:
                dis = j-i -(Y-X-1)
            elif j < Y-1:
                dis = min([j-i, (X-1)-i+1+abs(j-(Y-1))])
                
        else:
            dis = min([j-i, i-(X-1)+1+abs(j-(Y-1))])
        
        # distances[i].append(dis)
        k = dis-1
        counts[k] += 1
        
for k in range(N-1):
    print(counts[k])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())
A = []
for _ in range(n):
  __ = input().split()
  A.append(np.array(__, dtype=int))
ans = []
for i in range(m):
  ans.append(i+1)
_ans = ans.copy()
for a in A:
  for i in range(len(ans)):
    if not ans[i] in a[1:]:
      _ans.remove(ans[i])
print(len(_ans))

Fixed submission:
import numpy as np
n, m = map(int, input().split())
A = []
for _ in range(n):
  __ = input().split()
  A.append(np.array(__, dtype=int))
ans = []
for i in range(m):
  ans.append(i+1)
_ans = ans.copy()
for a in A:
  for i in range(len(ans)):
    if not ans[i] in a[1:]:
      _ans.remove(ans[i])
  ans = _ans.copy()
  
print(len(_ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
c = list(input())

cnt = 0
for i in range(N):
  if c[i] == 'W':
    flag = True
    for j in range(N-1,i,-1):
      if c[j] == 'R':
        c[j] = 'W'
        cnt+=1
        flag = False
        break
    if flag:
      break
print(cnt)

Fixed submission:
N = int(input())
c = list(input())

cnt = 0
w_last_index = N-1
for i in range(N):
  if c[i] == 'W':
    flag = True
    for j in range(w_last_index,i,-1):
      if c[j] == 'R':
        c[j] = 'W'
        w_last_index=j
        cnt+=1
        flag = False
        break
    if flag:
      break
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      if v<10050:
        ans[v]+=1

for i in range(n):
  print(ans[i+1])

Fixed submission:
L,R,d = map(int,input().split())
print(int(R/d)-int((L-1)/d))
Buggy python submission (verdict: Runtime Error):
S = input()

if "RRR" in S:
    ans = 3

elif "RR" in S:
    ans = 2
    
elif "R" in S:
    ans = 1
    
print(ans)

Fixed submission:
S = input()

if "RRR" in S:
    ans = 3

elif "RR" in S:
    ans = 2
    
elif "R" in S:
    ans = 1
else:
    ans = 0
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = 1
    n = 7
    for i in range(K):
        
        if n%K ==0:
            print(ans)
            break
        
        n = (10*n + 7)%K  
        ans += 1
main()

Fixed submission:
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    K = I()
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = 1
    n = 7
    for i in range(K):
        
        if n%K ==0:
            print(ans)
            break
        
        n = (10*n + 7)%K  
        ans += 1
    
    else:
        print('-1')

main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    K = I()
    
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = len(str(K))
    while 1:
        
        num = int('7'*ans)
        
        if num%K == 0:
            print(ans)
            break
        
        ans += 1

main()

Fixed submission:
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    K = I()
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = 1
    n = 7
    for i in range(K):
        
        if n%K ==0:
            print(ans)
            break
        
        n = (10*n + 7)%K  
        ans += 1
    
    else:
        print('-1')

main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    K = I()
    
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = len(str(K))
    while 1:
        
        num = int('7'*ans)
        
        if num%K == 0:
            print(ans)
            break
        
        ans += 1

main()

Fixed submission:
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    K = I()
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = 1
    n = 7
    for i in range(K):
        
        if n%K ==0:
            print(ans)
            break
        
        n = (10*n + 7)%K  
        ans += 1
    
    else:
        print('-1')

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    
    K = int(input())
    if K%2 == 0:
        print('-1')
        exit()
    
    ans = len(str(K))
    while 1:
        
        num = int('7'*ans)
        
        if num%K == 0:
            print(ans)
            break
        
        ans += 1

main()

Fixed submission:
import sys
input = sys.stdin.readline
 
def I(): return int(input())

def main():
    
    K = I()
    if K%2 == 0:
        print('-1')
        sys.exit()
    
    ans = 1
    n = 7
    for i in range(K):
        
        if n%K ==0:
            print(ans)
            break
        
        n = (10*n + 7)%K  
        ans += 1
    
    else:
        print('-1')

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

for i in range(n):
    tmp = input()
    if tmp not in arr:
        ans += 1
        arr.append(tmp)

print(ans)

Fixed submission:
n = int(input())
ans = 0
arr = []

for i in range(n):
    arr.append(input())

arr = set(arr)

print(len(arr))
Buggy python submission (verdict: Runtime Error):
n,d = mat(int,input().split())

if n % (d*2+1) != 0:
  print(int(n % (d*2+1) + 1)) 
 else:
  print(int(n % (d*2+1)))

Fixed submission:
n,d = map(int,input().split())
 
if n % (d*2+1) != 0:
  print(int(n // (d*2+1) + 1)) 
else:
  print(int(n // (d*2+1)))
Buggy python submission (verdict: Runtime Error):
n,a.b = map(int,input().split())

print(min(n*a,b))

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

print(min(n*a,b))
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

tmp = math.sqrt(p)

if n == 1:
    print(p)
else:
    for i in range(1,int(tmp)+1):
        if p % (i ** n) == 0:
            ans = i
    print(ans)

Fixed submission:
import math

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

tmp = math.sqrt(p)

if n == 1:
    print(p)
elif n >=100:
    print(1)
else:
    for i in range(1,int(tmp)+1):
        if p % (i ** n) == 0:
            ans = i
    print(ans)

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

if n == 1:
    print(p)
else:
    for i in range(1,1000001):
        if p % (i ** n) == 0:
            ans = i
    print(ans)

Fixed submission:
import math

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

tmp = math.sqrt(p)

if n == 1:
    print(p)
elif n >=100:
    print(1)
else:
    for i in range(1,int(tmp)+1):
        if p % (i ** n) == 0:
            ans = i
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())

arr = []
for i in range(n):
	arr += [int(input())]
	
arr2 = sorted(arr)

ans = float('inf')

for y in range(n-k+1):
	mx = max(arr2[y:y+k])
	mn = min(arr2[y:y+k])
	ans = min(ans,mx-mn)

print(ans)
	
	
	

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

arr = []
for i in range(n):
	arr += [int(input())]
	
arr2 = sorted(arr)

ans = float('inf')

for y in range(n-k+1):
	mx = arr2[y+k-1]
	mn = arr2[y]
	ans = min(ans,mx-mn)

print(ans)

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

arr = []
for i in range(n):
	arr += [int(input())]
	
arr2 = sorted(arr)

ans = float('inf')

for i in range(n-k+1):
	mx = max(arr2[i:i+k])
	mn = min(arr2[i:i+k])
	ans = min(ans,mx-mn)

print(ans)


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

arr = []
for i in range(n):
	arr += [int(input())]
	
arr2 = sorted(arr)

ans = float('inf')

for y in range(n-k+1):
	mx = arr2[y+k-1]
	mn = arr2[y]
	ans = min(ans,mx-mn)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
arr = []
for i in range(m):
	ls = list(map(int,input().split()))
	arr.append(ls)

def st(a):
	b = list(str(a))
	while len(b) <= 5:
		b.insert(0,'0')
	c= ''.join(b)
	return c

for y in arr:
	k = 1
	for j in arr:
		if y[0] == j[0] and y[1] > j[1]:
			k += 1
	print('{}{}'.format(st(y[0]), st(k)))




Fixed submission:

n,m = map(int,input().split())
arr = []
for i in range(m):
	ls = list(map(int,input().split()))+[i]
	arr.append(ls)

arr.sort(key=lambda x:x[1])

def st(a):
	b = list(str(a))
	while len(b) <= 5:
		b.insert(0,'0')
	c= ''.join(b)
	return c

dic = {}
for j in range(m):
	if arr[j][0] in dic:
		dic[arr[j][0]] += 1
		arr[j] += [dic[arr[j][0]]]
	else:
		dic[arr[j][0]] = 1
		arr[j] += [dic[arr[j][0]]]

arr.sort(key=lambda x:x[2])

for y in range(m):
	print('{}{}'.format(st(arr[y][0]), st(arr[y][3])))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
arr = []
for i in range(m):
	ls = list(map(int,input().split()))
	arr.append(ls)

def st(a):
	b = list(str(a))
	while len(b) <= 5:
		b.insert(0,'0')
	c= ''.join(b)
	return c

for y in arr:
	k = 1
	for j in arr:
		if y[0] == j[0] and y[1] > j[1]:
			k += 1
			
	print('{}{}'.format(st(y[0]), st(k)))




Fixed submission:

n,m = map(int,input().split())
arr = []
for i in range(m):
	ls = list(map(int,input().split()))+[i]
	arr.append(ls)

arr.sort(key=lambda x:x[1])

def st(a):
	b = list(str(a))
	while len(b) <= 5:
		b.insert(0,'0')
	c= ''.join(b)
	return c

dic = {}
for j in range(m):
	if arr[j][0] in dic:
		dic[arr[j][0]] += 1
		arr[j] += [dic[arr[j][0]]]
	else:
		dic[arr[j][0]] = 1
		arr[j] += [dic[arr[j][0]]]

arr.sort(key=lambda x:x[2])

for y in range(m):
	print('{}{}'.format(st(arr[y][0]), st(arr[y][3])))
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())

ans = 'Yes'

for j in range(len(s)):
    if s.count(s[j]) != t.count(t[j]):
        ans = 'No'

print(ans)


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

counta={}
countb={}

for i in s:
    if i in counta:
        counta[i] += 1
    else:
        counta[i] = 1

for y in t:
    if y in countb:
        countb[y] += 1
    else:
        countb[y] = 1

if sorted(counta.values())  == sorted(countb.values()):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())

arr = [[s[i],t[i]] for i in range(len(s))]

ans = 'Yes'

for j in range(len(s)):
    if s.count(s[j]) != t.count(t[j]) or s.count(s[j]) != arr.count(arr[j]):
        ans = 'No'

print(ans)


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

counta={}
countb={}

for i in s:
    if i in counta:
        counta[i] += 1
    else:
        counta[i] = 1

for y in t:
    if y in countb:
        countb[y] += 1
    else:
        countb[y] = 1

if sorted(counta.values())  == sorted(countb.values()):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
t = list(input())
#s = ['a','b','a']
#t = ['d','e','f']

arr = [[s[i],t[i]] for i in range(len(s))]

ans = 'Yes'

for y in arr:
	for j in range(len(s)):
		if y[0] == arr[j][0] and y[1] != arr[j][1]:
			ans = 'No'
		elif y[1] == arr[j][1] and y[0] != arr[j][0]:
			ans = 'No'


print(ans)
	
	




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

counta={}
countb={}

for i in s:
    if i in counta:
        counta[i] += 1
    else:
        counta[i] = 1

for y in t:
    if y in countb:
        countb[y] += 1
    else:
        countb[y] = 1

if sorted(counta.values())  == sorted(countb.values()):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
s = list(map(str, input()))
t = list(map(str, input()))

sarr = []
tarr = []
flg = 0
for i in list(range(len(s))):
    if s[i] != t[i]:
        sarr.append(s[i])
        tarr.append(t[i])
        
for i in list(range(len(sarr))):
    if sarr.count(sarr[i]) != tarr.count(tarr[i]):
        flg = 1
    
if len(set(sarr)) == len(set(tarr)) and flg == 0:
    print('Yes')
else:
    print('No')
        



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

counta={}
countb={}

for i in s:
    if i in counta:
        counta[i] += 1
    else:
        counta[i] = 1

for y in t:
    if y in countb:
        countb[y] += 1
    else:
        countb[y] = 1

if sorted(counta.values())  == sorted(countb.values()):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s = list(map(int, input()))
k = int(input())

ans = 1

for i in range(len(min(s,k))):
	if s[i] != 1:
		ans = s[i]
		break

print(ans)
		
	

Fixed submission:
s = list(map(int, input()))
k = int(input())

i=0

while i <= k-1:
	if s[i] == 1:
		ans = 1
		i += 1
	else:
		ans = s[i]
		break

print(ans)

Buggy python submission (verdict: Runtime Error):
s = list(map(int, input()))
k = int(input())

ans = 1

for i in range(len(k)):
	if s[i] != 1:
		ans = s[i]
		break

print(ans)
		
	

Fixed submission:
s = list(map(int, input()))
k = int(input())

i=0

while i <= k-1:
	if s[i] == 1:
		ans = 1
		i += 1
	else:
		ans = s[i]
		break

print(ans)

Buggy python submission (verdict: Runtime Error):
s = list(map(str, input()))
k = int(input())

i=0

while i <= k:
	if s[i] =='1':
		ans = 1
		i += 1
	else:
		ans = s[i]
		break

print(ans)

Fixed submission:
s = list(map(int, input()))
k = int(input())

i=0

while i <= k-1:
	if s[i] == 1:
		ans = 1
		i += 1
	else:
		ans = s[i]
		break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
k = int(input())

arr = []

for i in range(len(s)):
    for j in range(i,len(s)):
        arr += [''.join(s[i:j+1])]

arr = list(set(arr))
arr.sort()
print(arr[k-1])

Fixed submission:
s = list(input())
k = int(input())

arr = []

for i in range(len(s)):
    for j in range(i,i+5):
        arr += [''.join(s[i:j+1])]

arr = list(set(arr))
arr.sort()
print(arr[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = list(map(int,input().split()))

for i in range(n):
    tarr = list(arr)
    tarr.remove(tarr[i])
    tarr.sort()
    print(tarr[(len(tarr) + 1) // 2 - 1])

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

tarr = list(arr)

tarr.sort()

num1 = tarr[len(tarr) // 2 - 1]
num2 = tarr[len(tarr) // 2]

for i in range(n):
    if arr[i] < num2:
        print(num2)
    else:
        print(num1)
Buggy python submission (verdict: Runtime Error):

N = int(input())
Z=[]
for i in range(N):
	t, x, y = map(int, input().split())
	if t % 2 == 0:
		if x + y <= t and (x + y) % 2 == 0:
			Z.append(1)
		else:
			Z.append(0)
	else:
		if x + y <= t and (x + y) % 2 == 1:
			Z.append(1)
		else:
			Z.append(0)
	i += 1
if Z.count(0) >=1:
	print('No')
else:
	print('Yes')




Fixed submission:
a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b = map(int, input().split())
if  b == 100:
    z = a*100 + b
elif b >= 10 and  b < 100:
    z = a*100 + b
elif b >= 0 and  b < 10:
    z = a*10 + b

e = np.sqrt(z)
f = float(e) - int(e)
if bool(f) == False:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a*b/2 % 0:
  print("Even")
  else:
    print("Odd")
    

Fixed submission:
a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):

N = int(input())
Z=[]
for i in range(N):
	t, x, y = map(int, input().split())
	if t % 2 == 0:
		if x + y <= t and (x + y) % 2 == 0:
			Z.append(1)
		else:
			Z.append(0)
	else:
		if x + y <= t and (x + y) % 2 == 1:
			Z.append(1)
		else:
			Z.append(0)
	i += 1

if Z.index(0) >= 1:
	print('No')
else:
	print('Yes')

Fixed submission:

N = int(input())
Z=[]
for i in range(N):
	t, x, y = map(int, input().split())
	if t % 2 == 0:
		if x + y <= t and (x + y) % 2 == 0:
			Z.append(1)
		else:
			Z.append(0)
	else:
		if x + y <= t and (x + y) % 2 == 1:
			Z.append(1)
		else:
			Z.append(0)
	i += 1
if Z.count(0) >=1:
	print('No')
else:
	print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n, y = map(int, input().split())
for a in range(n+1):
	
	for b in range(n+1):
		
		for c in range(n+1):
			if a + b + c == n :
				if 10000*a + 5000*b + 1000*c == y:
					print('{} {} {}'.format(a,b,c))
					sys.exit()
print('-1 -1 -1')

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

for a in list(range(n+1)):
	for b in list(range(n+1-a)):
		c = n - a - b
		if a+b+c==n and 10000*a + 5000*b + 1000*c==y:
			print('{} {} {}'.format(a,b,c))
			sys.exit()

print('-1 -1 -1')