Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y=map(str,input().split())
X=x[::-1]
if X==y:
    print('YES')
else:
    print('NO')

Fixed submission:
x=str(input())
y=str(input())
X=x[::-1]
if X==y:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
A,B=[int(x) for in x input().split()]
if A==1:
  A=14
if B==1:
  B=14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  print('Drow')

Fixed submission:
A,B=[int(x) for x in input().split()]
if A==1:
  A=14
if B==1:
  B=14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  print('Draw')

Buggy python submission (verdict: Runtime Error):
A,B=[int(x) for in x input().split()]
if A=1:
  A==14
if B=1:
  B==14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  print('Drow')

Fixed submission:
A,B=[int(x) for x in input().split()]
if A==1:
  A=14
if B==1:
  B=14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  print('Draw')

Buggy python submission (verdict: Runtime Error):
A,B=(int(x) forx in input.split())
if A=1:
  A==14
if B=1:
  B==14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  ('Drow')

Fixed submission:
A,B=[int(x) for x in input().split()]
if A==1:
  A=14
if B==1:
  B=14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  print('Draw')

Buggy python submission (verdict: Runtime Error):
1<=A<=13
1<=B<=13

if A > B >=2 or A=1 ,B >= 2 :
  print(Alice)
elif B > A =2 or B=1 ,A >= 2:
  print(Bob)
elif A = B:
  print(Draw)
    

Fixed submission:
A,B=[int(x) for x in input().split()]
if A==1:
  A=14
if B==1:
  B=14
if A>B:
  print('Alice')
elif B>A:
  print('Bob')
else:
  print('Draw')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
print(a+' '+b+' '+c)

Fixed submission:
a,b,c=map(str,input().split(','))
print(a+' '+b+' '+c)
Buggy python submission (verdict: Runtime Error):
def AtCoder_A():
    Prices=input().split()
    print(Prices)
    Train=min(int(Prices[0]),int(Prices[1]))
    Bus=min(int(Prices[2]),int(Prices[3]))
    print(Train+Bus)
    return

AtCoder_A()


Fixed submission:
def AtCoder_A():
    Prices=[]
    for i in range(4):
        Prices.append(input())
    Train=min(int(Prices[0]),int(Prices[1]))
    Bus=min(int(Prices[2]),int(Prices[3]))
    print(Train+Bus)
    return

AtCoder_A()
Buggy python submission (verdict: Runtime Error):
import math as M
N=input()
List=[]
for i in range(N):
    n=int(input())
    if n not in List:
        List.append(int(input()))

print(List.count())

Fixed submission:
import math as M
N=int(input())
list=[]
for i in range(N):
    n=int(input())
    if n not in list:
        list.append(n)

print(list.__len__())
Buggy python submission (verdict: Runtime Error):
s = input()
l = [int(x) for x in input().split()]
a, b = l[0], l[1]
print(max(a+b, max(a-b, a*b)))

Fixed submission:
s = input()
l = [int(x) for x in s.split()]
a, b = l[0], l[1]
print(max(a+b, max(a-b, a*b)))
Buggy python submission (verdict: Runtime Error):
input()
a = list(map(str, input().split()))
b = list(map(int, input().split()))
if sorted(b) == a:
    print("YES")
else:
    m = 0
    for i in range(len(a)):
        if a[i] in sorted(b)[i]:
            m+=1
    if m==len(a)-2:
        print("YES")
    else:
        print("NO")

Fixed submission:
input()
g = input()
a = list(map(str, g.split()))
b = list(map(int, g.split()))
if sorted(b) == b:
    print("YES")
else:
    m = 0
    for i in range(len(b)):
        if b[i] == sorted(b)[i]:
            m+=1
    if m==len(b)-2:
        print("YES")
    else:
        print("NO")
Buggy python submission (verdict: Runtime Error):
d = list(map(int, d.split()))
if d[0] < d[1]:
  print(0)
else:
  print(10)

Fixed submission:
d = list(map(int, input().split()))
if d[0] < d[1]:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
 
import numpy as np
 
a = np.cumsum(W)
 
print(int(min(abs(sum(w)/2 - a))*2))

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
 
S1 = 0
S2 = 0
ans = []
 
for i in range(N-1):
  S1 = sum(W[:i+1])
  S2 = sum(W[i+1:])
  ans.append(abs(S1-S2))
print(min(ans))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
  s,p=[x for x in input().rstrip().split()]
  l.append([s,int(p),i+1])
l.sort(key=lambda x:x[1],reverse=True)
l.sort(key=lambda x:x[0])

for s,p,i in l:
  print(i) 


Fixed submission:
l = [int(i) for i in input().split() if i.isdigit()]
print(int((3 * l[0] + l[1]) / 2))

Buggy python submission (verdict: Runtime Error):
n = int(input())
list_shop = []
 
for i in range(n):
  t = []
  a, b = input().split()
  t.append(a)
  t.append(b)
  t.append(str(i + 1))
  list_shop.append(t)
 
check = 0
c = []
 
list_shop = sorted(list_shop, key=lambda x: x[0])
 
for i in range(len(list_shop) - 1):
  if(list_shop[i][0] == list_shop[i + 1][0]):
    check = 1
  else:
    check = 0
 
  c.append(list(map(int, list_shop[i][1:3])))
  if(check == 1):
    continue
  else:
    c.sort(key=lambda x:x[0], reverse=True)
    for j in c:
      print(int(j[1]))
    c = []
 
if(check == 1):
  c.append(list(map(int, list_shop[n - 1][1:3])))
  c.sort(key=lambda x:x[0], reverse=True)
  for i in c:
    print(i[1])
else:
  print(int(list_shop[n - 1][2]))

Fixed submission:
l = [int(i) for i in input().split() if i.isdigit()]
print(int((3 * l[0] + l[1]) / 2))
Buggy python submission (verdict: Runtime Error):
while True:
    c = input()
    c = [int(c[0] + c[1]),int(c[2] + c[3])]
    g = ""
    if c[0] > 12 and c[1] < 13 and c[1] != 0:
        g = "YYMM"
    if c[0] < 13 and c[1] > 12 and c[0] != 0:
        g = "MMYY"
    if c[0] < 13 and c[1] < 13:
        g = "AMBIGUOUS"
    if c[0] < 1 or c[1] < 1 or c[1] > 12 and c[0] > 12:
        g = "NA"
    print(g)

Fixed submission:
s=(input())
s1=int(s[:2])
s2=int(s[2:])
 
if 1<= s1 <=12 and 1<= s2 <= 12:
    print("AMBIGUOUS")
 
elif 0<= s1 <=99 and 1<= s2 <= 12:
    print("YYMM")
 
elif 1<= s1 <=12 and 0<= s2 <= 99:
    print("MMYY")
 
else:
    print("NA")
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
s = 1
for i in range(a[0],a[1]):
    s *= i
s *= a[1]
if s < 0:
    print("Negative")
elif s > 0:
    print("Positive")
else:
    print("Zero")

Fixed submission:
a, b = map(int, input().split())
ans = ''
if a > 0 and b > 0:
  ans = 'Positive'
elif a <= 0 and b >= 0:
  ans = 'Zero'
elif a < 0 and  b < 0:
  if (b - a) % 2 == 0:
    ans = 'Negative'
  else:
    ans = 'Positive'
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())

p=0
for i in range(1,N):
    if i%2==1:
        p +=1
print(p/n)

Fixed submission:
N=int(input())

p=0
for i in range(N+1):
    if i%2==1:
        p +=1
print(p/N)
Buggy python submission (verdict: Runtime Error):
list = input().split()
ans = list[0] * list[1] * list[2]

if ans == 5*5*7:
  Print('YES')
else:
  Print('NO)


Fixed submission:
list1 = input().split()
ans = int(list1[0]) * int(list1[1]) * int(list1[2])
 
if ans == 5*5*7:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
list = input().split()
ans = input[0] * input[1] * input[2]

if ans == 5*5*7:
  Print('YES')
else:
  Print('NO)


Fixed submission:
list1 = input().split()
ans = int(list1[0]) * int(list1[1]) * int(list1[2])
 
if ans == 5*5*7:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
N,K = (int(i) for i in input().split())
S = list(input())

cnt = 0
x = 1
tmp = S[0]
while cnt < K and x <= N-1:
    if S[x] != tmp:
        S[x] = tmp
        x += 1
        while S[x] != tmp and x <= N-1:
            S[x] = tmp
            x += 1
            if x > N-1:
                break
        cnt += 1
        if x > N-1:
            break

    else:
        x += 1


ans = 0
for i in range(N-1):
    if S[i] == S[i+1]:
        ans += 1

print(ans)


Fixed submission:
N,K = (int(i) for i in input().split())
S = list(input())

cnt = 0
x = 1
tmp = S[0]
while cnt < K and x <= N-1:
    if S[x] != tmp:
        S[x] = tmp
        x += 1
        if x > N-1:
            break
        while S[x] != tmp and x <= N-1:
            S[x] = tmp
            x += 1
            if x > N-1:
                break
        cnt += 1
        if x > N-1:
            break

    else:
        x += 1


ans = 0
for i in range(N-1):
    if S[i] == S[i+1]:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N,K = (int(i) for i in input().split())
S = list(input())

cnt = 0
x = 1
tmp = S[0]
while cnt < K and x <= N-1:
    if S[x] != tmp:
        S[x] = tmp
        x += 1
        while S[x] != tmp and x <= N-1:
            S[x] = tmp
            x += 1
            if x > N-1:
                break
        cnt += 1

    else:
        x += 1

    if x > N-1:
        break

ans = 0
for i in range(N-1):
    if S[i] == S[i+1]:
        ans += 1

print(ans)


Fixed submission:
N,K = (int(i) for i in input().split())
S = list(input())

cnt = 0
x = 1
tmp = S[0]
while cnt < K and x <= N-1:
    if S[x] != tmp:
        S[x] = tmp
        x += 1
        if x > N-1:
            break
        while S[x] != tmp and x <= N-1:
            S[x] = tmp
            x += 1
            if x > N-1:
                break
        cnt += 1
        if x > N-1:
            break

    else:
        x += 1


ans = 0
for i in range(N-1):
    if S[i] == S[i+1]:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B = (int(i) for i in input().split())

if B == 1:
    print(0)

else:
    ans = 1
    while 1:
        if A + (A-1) * (ans - 1) >= B:
            break
            ans += 1

    print(ans)


Fixed submission:
A,B = (int(i) for i in input().split())

if B == 1:
    print(0)

else:
    ans = 1
    while 1:
        if A + (A-1) * (ans - 1) >= B:
            break
        ans += 1

    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = (int(i) for i in input().split())
A = [0]*(N+1)
B = [0]*(N+1)

ans = 0
for i in range(N):
    A[i],B[i] = (int(j) for j in input().split())

for j in range(1,M+1):
    max = -1
    temp = -1
    for i in range(N):
        if A[i]<=j and B[i] > max :
            max = B[i]
            temp = i
    if temp != -1:
        ans+=B[temp]
        A[temp] = M+1

print(ans)


Fixed submission:
from heapq import heappush,heappop

N,M = (int(i) for i in input().split())
a = [0] *N
b = [0] *N
T = []
list = [[] for i in range(M+1)]

for i in range(N):
    a[i],b[i] = map(int,input().split())
    if a[i] <= M:
        list[a[i]].append(b[i])

k = 0
ans = 0
for j in range(1,M+1):
    for i in list[j]:
        heappush(T,-1 * i)
    if T != []:
        ans += -1 * heappop(T)

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

N = int(input())
H = [int (i) for i in input().split()]
flag = 1
minH = min(H)
maxH = max(H)


if N == 1:
    flag = 1
elif N == 2:
    if H[0] > H[1]+1:
        flag = 0
elif maxH-minH <= 1:
    print("Yes")
    sys.exit()
else:
    for i in range(N-1):
        if H[i] > H[i+1]+1:
            print("No")
            sys.exit()
        elif H[i] > H[i+1]:
            for j in range(i,N):
                if H[i] > H[j] + 1:
                    print("No")
                    sys.exit()

if flag == 0:
    print("No")
else:
    print("Yes")


Fixed submission:
N = int(input())
H = [int (i) for i in input().split()]
flag = 1

if N == 1:
    flag = 1
else:
    for i in range(N-2,-1,-1):
        if H[i] > H[i+1]:
            H[i] -= 1
    for i in range(N-1):
        if H[i] > H[i+1]:
            flag = 0

if flag == 0:
    print("No")
else:
    print("Yes")

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

N = int(input())
H = [int (i) for i in input().split()]
flag = 1
minH = 10000000000

if N == 1:
    flag = 1
elif N == 2:
    if H[0] > H[1]+1:
        flag = 0
else:
    for i in range(N-1):
        if H[i] > H[i+1]:
            for j in range(i,N):
                if H[i] > H[j] + 1:
                    print("No")
                    sys.exit()

if flag == 0:
    print("No")
else:
    print("Yes")


Fixed submission:
N = int(input())
H = [int (i) for i in input().split()]
flag = 1

if N == 1:
    flag = 1
else:
    for i in range(N-2,-1,-1):
        if H[i] > H[i+1]:
            H[i] -= 1
    for i in range(N-1):
        if H[i] > H[i+1]:
            flag = 0

if flag == 0:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = [int (i) for i in input().split()]
flag = 1
minH = 10000000000

if N == 1:
    flag = 1
elif N == 2:
    if H[0] > H[1]+1:
        flag = 0
else:
    for i in range(N-1):
        for j in range(i,N):
            if H[i] > H[j] + 1:
                flag = 0
if flag == 0:
    print("No")
else:
    print("Yes")


Fixed submission:
N = int(input())
H = [int (i) for i in input().split()]
flag = 1

if N == 1:
    flag = 1
else:
    for i in range(N-2,-1,-1):
        if H[i] > H[i+1]:
            H[i] -= 1
    for i in range(N-1):
        if H[i] > H[i+1]:
            flag = 0

if flag == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import math
S=input()
hatena = S.count("?")
S_temp = int(S.replace("?","0"))
Q = 10 ** hatena
S_temp_amari =(S_temp-5) %13
temp = math.floor((Q-S_temp_amari)/13)
print(temp%(1000000000+7))


Fixed submission:
import math
S=input()
dp=[0]*13
dp[0]=1
# dp[k] 13で割った余りkのパターン数
mod = 1000000007

for i in range(len(S)):
    nextDp=[0]*13
    if S[i] == "?":
        for j in range(13):
            for k in range(10):
                nextDp[((10*j) + k) % 13] += dp[j]
                nextDp[((10*j) + k) % 13] %= mod
    else:
        k = int(S[i])
        for j in range(13):
            nextDp[((10*j) + k) % 13] += dp[j]
            nextDp[((10*j) + k) % 13] %= mod
    for j in range(13):
        dp[j] = nextDp[j]

print(dp[5])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for i in range(N)]
i=0
for i in range(N):
    temp=A[i]
    del A[i]
    print(max(A))
    A.insert(i,temp)
    i += 1


Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
B=sorted(A,reverse=True)
maxA=B[0]
secondA=B[1]
i=0
for i in range(N):
    if A[i] == maxA:
        print(secondA)
    else:
        print(maxA)
    i += 1

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for i in range(N)]
i=0
while i < N:
    cont=A[i]
    del A[i]
    print(max(A))
    A.insert(i,cont)
    i += 1


Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
B=sorted(A,reverse=True)
maxA=B[0]
secondA=B[1]
i=0
for i in range(N):
    if A[i] == maxA:
        print(secondA)
    else:
        print(maxA)
    i += 1

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for i in range(N)]
i=0
while i < N:
    cont=A[i]
    del A[i]
    print(max(A))
    A.insert(i,cont)
    i += 1

Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
B=sorted(A,reverse=True)
maxA=B[0]
secondA=B[1]
i=0
for i in range(N):
    if A[i] == maxA:
        print(secondA)
    else:
        print(maxA)
    i += 1

Buggy python submission (verdict: Time Limit Exceeded):


N=int(input())
A=[int(input()) for i in range(N)]
A=list(map(int,A))
i=0
while i < N:
    cont=A[i]
    del A[i]
    print(max(A))
    A.insert(i,cont)
    i += 1


Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
B=sorted(A,reverse=True)
maxA=B[0]
secondA=B[1]
i=0
for i in range(N):
    if A[i] == maxA:
        print(secondA)
    else:
        print(maxA)
    i += 1
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
d = [int(i) for i in input().split()]
K = max(d)
ans = 0

for i in range(K+1):
    temp_abc = 0
    temp_arc = 0
    for j in range(N):
        if d[j] >= i:
            temp_abc += 1
        else:
            temp_arc += 1
    if temp_abc == temp_arc:
        ans += 1

print(ans)


Fixed submission:
N = int(input())
d = [int(i) for i in input().split()]
D = sorted(d)

ans = D[int(N/2)] - D[int((N/2) - 1)]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
H,W = (int(i) for i in input().split())
S = [0] * H
for i in range(H):
    S[i] = list(input())

x = [] * W
y = [] * H
L = [[1]*W for i in range(H)]
R = [[1]*W for i in range(H)]
U = [[1]*W for i in range(H)]
D = [[1]*W for i in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            L[i][j] = 0
            U[i][j] = 0
        elif i == 0 and j == 0:
            continue
        elif i == 0:
            L[i][j] = L[i][j-1] + 1
        elif j == 0:
            U[i][j] = U[i-1][j] + 1
        else:
            L[i][j] = L[i][j-1] + 1
            U[i][j] = U[i-1][j] + 1

for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if S[i][j] == "#":
            R[i][j] = 0
            D[i][j] = 0
        elif i == H-1 and j == W-1:
            continue
        elif i == H-1:
            R[i][j] = R[i][j+1] + 1
        elif j == W-1:
            D[i][j] = D[i+1][j] + 1
        else:
            R[i][j] = R[i][j+1] + 1
            D[i][j] = D[i+1][j] + 1

for i in range(H):
    for j in range(W):
        tmp = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3
        if tmp > ans:
            ans = tmp

print(ans)


Fixed submission:
H,W = (int(i) for i in input().split())
S = [0] * H
for i in range(H):
    S[i] = input()

L = [[1]*W for i in range(H)]
R = [[1]*W for i in range(H)]
U = [[1]*W for i in range(H)]
D = [[1]*W for i in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            L[i][j] = 0
            U[i][j] = 0
        elif i == 0 and j == 0:
            continue
        elif i == 0:
            L[i][j] = L[i][j-1] + 1
        elif j == 0:
            U[i][j] = U[i-1][j] + 1
        else:
            L[i][j] = L[i][j-1] + 1
            U[i][j] = U[i-1][j] + 1


for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if S[i][j] == "#":
            R[i][j] = 0
            D[i][j] = 0
        elif i == H-1 and j == W-1:
            R[i][j] = 1
        elif i == H-1:
            R[i][j] = R[i][j+1] + 1
        elif j == W-1:
            D[i][j] = D[i+1][j] + 1
        else:
            R[i][j] = R[i][j+1] + 1
            D[i][j] = D[i+1][j] + 1
        tmp = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3
        if tmp > ans:
            ans = tmp

print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
if N % 2 == 1:
  print(int(N/2)/N)
else:
  print(0.5)

Fixed submission:
N = int(input())
if N % 2 == 1:
  print((int(N/2) + 1)/N)
else:
  print(0.5)

Buggy python submission (verdict: Runtime Error):
N = float(input())
if N % 2.0 == 1.0:
  print(((N + 1.0)/2.0)/N)
else:
  print((N/2.0/)N)

Fixed submission:
N = int(input())
if N % 2 == 1:
  print((int(N/2) + 1)/N)
else:
  print(0.5)

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 1:
  print(((N + 1)/2)/N)
else:
  print((N/2/)N)

Fixed submission:
N = int(input())
if N % 2 == 1:
  print((int(N/2) + 1)/N)
else:
  print(0.5)

Buggy python submission (verdict: Runtime Error):
N = input()
if N % 2 == 1:
  print(((N + 1)/2)/N)
else:
  print((N/2/)N)

Fixed submission:
N = int(input())
if N % 2 == 1:
  print((int(N/2) + 1)/N)
else:
  print(0.5)

Buggy python submission (verdict: Runtime Error):
num = int(input())
if(num%2==0):
  print(0.5)
else:
  print(((n+1)/2)/n)
  

Fixed submission:
num = int(input())
if(num%2==0):
  print(0.5)
else:
  print(((num+1)/2)/num)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int, input().split()))


for i in range (N):
    print(l.index(i + 1) + 1, end=" ")

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

l_sorted = [0] * N

for i in range(N):
    l_sorted[l[i] - 1] = i + 1



for i in range (N):
    print(l_sorted[i])
Buggy python submission (verdict: Time Limit Exceeded):
'''input
5 1
00010
'''


N, K=map(int,input().split())
Sstr=input()
# print(Sstr)
S=[]

for i in range(N):
	S.append(int(Sstr[i]))

# print(S)
# flip=0
# for i in range(N-1):
# 	flip+=abs(S[i+1]-S[i])
# print(flip)


now=1
cnt=0
Nums=[]
for i in range(N):
	if S[i]==now:
		cnt+=1
	else:
		Nums.append(cnt)
		now=1-now
		cnt=1

if cnt!=0:
	Nums.append(cnt)

if(len(Nums)%2==0):
	Nums.append(0)

Add=2*K+1
ans=0

for i in range(0, len(Nums), 2):
	tmp=0
	left=i
	right=min(i+Add, len(Nums))
	for j in range(left, right):
		tmp+=Nums[j]
	ans=max(tmp,ans)

print(ans)

Fixed submission:
'''input
5 1
00010
'''


N, K=map(int,input().split())
Sstr=input()
# print(Sstr)
S=[]

for i in range(N):
	S.append(int(Sstr[i]))

# print(S)
# flip=0
# for i in range(N-1):
# 	flip+=abs(S[i+1]-S[i])
# print(flip)


now=1
cnt=0
Nums=[]
for i in range(N):
	if S[i]==now:
		cnt+=1
	else:
		Nums.append(cnt)
		now=1-now
		cnt=1

if cnt!=0:
	Nums.append(cnt)

if(len(Nums)%2==0):
	Nums.append(0)

Add=2*K+1
ans=0

left=0
right=0
tmp=0

for i in range(0, len(Nums), 2):
	# tmp=0
	Nextleft=i
	Nextright=min(i+Add, len(Nums))
	# for j in range(left, right):
	# 	tmp+=Nums[j]
	while(Nextleft>left):
		tmp-=Nums[left]
		left+=1
	while(Nextright>right):
		tmp+=Nums[right]
		right+=1
	
	ans=max(tmp,ans)

print(ans)
Buggy python submission (verdict: Runtime Error):
'''input
123
123
123
123
123
'''

a=[]

for i in range(5):
	a.append(int(input()))
# print(a)
flag=[]

for i in range(5):
	if a[i]%10!=0:
		flag.append(a[i]%10)
	else:
		flag.append(-1)
# print(flag)

endInd=float('inf')
end=float('inf')

for i in range(5):
	if flag[i]>0 and end>flag[i]:
		end=flag[i]
		endInd=i
# print(a[endInd])

if endInd=='inf':
	print(sum(a))
else:
	s=a[endInd]
	# print(s)
	a.pop(endInd)
	flag.pop(endInd)
	# print(a)
	for i in range(4):
		if flag[i]>0:
			a[i]=(a[i]//10+1)*10
	# print(a)
	s+=sum(a)
	print(s)


Fixed submission:
'''input
101
86
119
108
57
'''

a=[]

for i in range(5):
	a.append(int(input()))
# print(a)
flag=[]

for i in range(5):
	if a[i]%10!=0:
		flag.append(a[i]%10)
	else:
		flag.append(-1)
# print(flag)

endInd=-1
end=float('inf')

for i in range(5):
	if flag[i]>0 and end>flag[i]:
		end=flag[i]
		endInd=i
# print(a[endInd])

if endInd==-1:
	print(sum(a))
else:
	s=a[endInd]
	# print(s)
	a.pop(endInd)
	flag.pop(endInd)
	# print(a)
	for i in range(4):
		if flag[i]>0:
			a[i]=(a[i]//10+1)*10
	# print(a)
	s+=sum(a)
	print(s)