Harryxun/stf_run huggingface dataset:
N,M=map(int,input.split())
A=[""]*N
B=[""]*M
for i in range(N):
  A[i]=input()
for i in range(M):
  B[i]=input()
flag=False
for i in range(N-M)
    if B[0] in A[i]:
      for j in range(1,M):
        if B[j] in A[i+j]:
          if j = M - 1:
            print("Yes")
            exit(0)
          else:
            continue
        else:
          break
          
print("No")

### FIXED CODE ###

N,M=map(int,input().split())
A=[""]*N
B=[""]*M
for i in range(N):
  A[i]=input()
for i in range(M):
  B[i]=input()
  
A_tmp=[""]*M
for i in range(N-M+1):
  for j in range(N-M+1):
    for k in range(M):
      A_tmp[k]=A[j+k][i:i+M]
    if A_tmp==B:
      print("Yes")
      exit(0)

print("No")
from networkx import Graph,predecessor
import matplotlib.pyplot as plt
#import networkx as nx

G = Graph() #無効グラフ生成
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(m)]
G.add_edges_from(ab) #辺リスト生成
preds = predecessor(G,source=1)  #sourceはstart node
print("Yes")
for i in range(2,n+1):
    print(preds[i][0])

#描画

### FIXED CODE ###

from networkx import Graph,predecessor

G = Graph() #無効グラフ生成
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(m)]
G.add_edges_from(ab) #辺リスト生成
preds = predecessor(G,source=1)  #sourceはstart node
print("Yes")
for i in range(2,n+1):
    print(preds[i][0])

#描画
#import matplotlib.pyplot as plt
#import networkx as nx
#nx.draw_networkx(G)
#plt.show()
import math
from fractions inport Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(math.floor(A*B))

### FIXED CODE ###

from math import floor 
from fractions import Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(floor(A*B))
n=int(input())
a=list(map(int,input().split()))

hat = [0,0,0]

mod = 10**9 + 7

ans=1
def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

for i in range(n):
    arr=my_index_multi(hat,a[i])

    ans = (ans*len(arr))%mod

    hat[arr[0]]+=1

print(ans)



### FIXED CODE ###

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

hat = [0,0,0]

mod = 10**9 + 7

ans=1

for i in range(n):
    tmp=0
    index=0
    for j,k in enumerate(hat):
        if k==a[i]:
            tmp+=1
            index=j

    ans = (ans*tmp)%mod

    hat[index]+=1

print(ans)
n = int(input())
if n == 3:
    print(2, 5, 63)
elif n == 4:
    print(2, 3, 4, 9)
else:
    l = [2, 3, 4, 9]
    a = 8
    b = 10
    while b <= 30000 and len(l) + 1 < n:
        l.append(a)
        l.append(b)
        a += 6
        b += 6
    c = 15
    d = 21
    while d <= 30000 and len(l) + 1 < n:
        l.append(c)
        l.append(d)
        c += 12
        d += 12
    t = 6
    while t <= 30000 and len(l) < n:
        l.append(t)
        t += 6
    print(' '.join(map(str, l)))


### FIXED CODE ###

def f(s):
    return len(s) != len(set(s)) or s[-1] >= 123


st = input()
if st == 'zyxwvutsrqponmlkjihgfedcba':
    print(-1)
    exit(0)
s = list(map(ord, st))
s += [97]
while f(s):
    if s[-1] == 123:
        s.pop()
    s[-1] += 1
print(''.join(map(chr, s)))
a,b,c=map(int,input().split())
print(c+" "+b+" "+a)

### FIXED CODE ###

a,b,c=map(str,input().split())
print(c+" "+a+" "+b)
n = int(input())
A = list(input())
A_change={}
B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
for i in A:
  for j in B:
    if i= j:
      A_change[i] = B[(B.index(j)+n)%26]
print(list(A_change.values()))

### FIXED CODE ###

n = int(input())
s = input()
ans = ""
for i in s:
  ans += chr(ord("A") + (ord(i)-ord("A")+n)%26)
print(ans)
n, m = [int(elem) for elem in input().split()]
a_lst = [int(elem) for elem in input().split()]
a_lst = sorted(a_lst)

lst = []
for i in range(m):
  b, c = [int(elem) for elem in input().split()]
  lst.append((c, b))
lst = sorted(lst)

i = 0
for c, b in lst:
  while c > a_lst[i] and b > 0:
    a_lst[i] = c
    i += 1
    b -= 1
  i = 0
print(sum(a_lst))
  

### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
bc=[list(map(int, input().split())) for _ in range(m)]

sorted_ab=sorted(bc, reverse=True, key=lambda x: x[1])
new_ab=[]
ans=[]

for i in range(m):
    if len(new_ab)<=n:
        tmp_l=[sorted_ab[i][1]]*sorted_ab[i][0]
        new_ab+=tmp_l
    else:
        break

final_list=a+new_ab
final_list.sort(reverse=True)
print(sum(final_list[:n]))
w,h,x,y=map(int,input().split())
print((w*h)/2)
if (w==2*x and h!=2*y) or (w!=2*x and h==2*y) or (x==0 and y==0) or (x==w and y==0) or (x==0 and y==h) or (x==w and y==h) or (w/x==h/y and w!=2*x) or (h/y==w/(w-x) and w-x==h and w!=2*x):
  print(0)
else:
  print(1)


### FIXED CODE ###

X,A = map(int, input().split())
if X<A:
  print(0)
else:
  print(10)
import math 
print("{0:f} {1:f}".format(r ** 2 * math.pi, r * 2 * math.pi))

### FIXED CODE ###

import math
r = float(input()) 
print(r ** 2 * math.pi, r * 2 * math.pi)
X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse = True)
B.sort(reverse = True)
C.sort(reverse = True)
ans = []

for i in range(min(X, int(K / 2))):
  for j in range(min(Y, int(K / 2))):
    for k in range(min(Z, int(K / 2))):
      ans.append(A[i] + B[j] + C[k])

ans.sort(reverse = True)

for i in range(K):
  print(ans[i])

### FIXED CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse = True)
B.sort(reverse = True)
C.sort(reverse = True)
ans = []

for i in range(min(X, K)):
  for j in range(min(Y, K)):
    if (i + 1) * (j + 1) > K:
      break
    for k in range(min(Z, K)):
      if (i + 1) * (j + 1) * (k + 1) > K:
        break
      ans.append(A[i] + B[j] + C[k])

ans.sort(reverse = True)

for i in range(K):
  print(ans[i])
n = int(input())
s = input()
for i in range((n//2)+1):
    if s[i] == s[i+(n//2)]:
        c+= 1
if c*2 == n:
    print("Yes")
else:
    print("No")
    

### FIXED CODE ###

n = int(input())
s = input()
c = 0
for i in range((n//2)):
    if s[i] == s[i+(n//2)]:
        c+= 1
if c*2 == n:
    print("Yes")
else:
    print("No")
from collections import deque
h, w =map(int, input().split())
s = [input() for i in range(h)]
s_x, s_y = 0, 0
##ある場所を塗る。その上でBFS。最大値を求める。
#最短経路で辿り着く時、塗りつぶす手は最大になる。
#最短経路の時は、通るますが考えうる中で一番少ないからねえ。そりゃそうか。
max = 0
c = [[0] * w for i in range(h)]
#cを定義する時は、横に並べてからそれを縦に並べる。つまり、列数を指定してから、その外で
#行数を指定する。ただ、要素にアクセスするときは、c[行番号][列番号]
#外側ほど、左側の要素になる？
def BFS():
    q = deque()
    q.append((s_x, s_y))

    while len(q) > 0:
        y, x = q.popleft()
        if y == h - 1 and x == w - 1:
            return c[y][x]
        if x < w - 1:
            if s[y][x+1] == '.' and c[y][x+1] == 0:
                q.append((y, x+1))
                c[y][x+1] = c[y][x] + 1
        if x > 0:
            if s[y][x-1] == '.' and c[y][x-1] == 0:
                q.append((y, x-1))
                c[y][x-1] = c[y][x] + 1
        if y < h - 1:
            if s[y+1][x] == '.' and c[y+1][x] == 0:
                q.append((y+1, x))
                c[y+1][x] = c[y][x] + 1
        if y > 0:
            if s[y-1][x] == '.' and c[y-1][x] == 0:
                q.append((y-1, x))
                c[y-1][x] = c[y][x] + 1

area = h*w
blunk_num_origin = 0
for ch1 in s:
    for ch2 in ch1:
        if ch2 == '#':
            blunk_num_origin += 1

min_grid = BFS()
sol = area-blunk_num_origin-2-(min_grid-1)
#print(area,min_grid,blunk_num_origin)
print(sol)


### FIXED CODE ###

from collections import deque
h, w =map(int, input().split())
s = [input() for i in range(h)]
s_x, s_y = 0, 0
##ある場所を塗る。その上でBFS。最大値を求める。
#最短経路で辿り着く時、塗りつぶす手は最大になる。
#最短経路の時は、通るますが考えうる中で一番少ないからねえ。そりゃそうか。
max = 0
c = [[0] * w for i in range(h)]
#cを定義する時は、横に並べてからそれを縦に並べる。つまり、列数を指定してから、その外で
#行数を指定する。ただ、要素にアクセスするときは、c[行番号][列番号]
#外側ほど、左側の要素になる？
def BFS():
    q = deque()
    q.append((s_x, s_y))

    while len(q) > 0:
        y, x = q.popleft()
        if y == h - 1 and x == w - 1:
            return c[y][x]
        if x < w - 1:
            if s[y][x+1] == '.' and c[y][x+1] == 0:
                q.append((y, x+1))
                c[y][x+1] = c[y][x] + 1
        if x > 0:
            if s[y][x-1] == '.' and c[y][x-1] == 0:
                q.append((y, x-1))
                c[y][x-1] = c[y][x] + 1
        if y < h - 1:
            if s[y+1][x] == '.' and c[y+1][x] == 0:
                q.append((y+1, x))
                c[y+1][x] = c[y][x] + 1
        if y > 0:
            if s[y-1][x] == '.' and c[y-1][x] == 0:
                q.append((y-1, x))
                c[y-1][x] = c[y][x] + 1

    return(-1)

area = h*w
blunk_num_origin = 0
for ch1 in s:
    for ch2 in ch1:
        if ch2 == '#':
            blunk_num_origin += 1

min_grid = BFS()
if min_grid == -1:
    print(min_grid)
else:
    sol = area-blunk_num_origin-2-(min_grid-1)
    #print(area,min_grid,blunk_num_origin)
    print(sol)
N = int(input())
p = list(map(int, input().split()))

count = 0
for i in range(N-1):
  if p[i] == i+1:
    p[i], p[i+1] = p[i+1], p[i]
    count += 1
if p[N-1] == N:
  p[N-2], p[N-1] = p[N-1], p[N-2]
  count += 1
  
print(count)

### FIXED CODE ###

X, t = map(int, input().split())
print(max(X - t,0))
N=int(input())
x=[0]
y=[0]

flag=1
for i in range(1,N+1):
  t,x_tmp,y_tmp=map(int,input().split())
  x.append(x_tmp)
  y.append(y_tmp)
  d=abs(x[i-1]-x[i])+abs(y[i-1]-y[i])
  if d>t or (d%2)!=(t%2):
    print("No")
    flag=0
    break
    
if flag==1:
  print("Yes")

### FIXED CODE ###

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

N=a*b

if N%2==0:
  print("Even")
else:
  print("Odd")
import math
from math import factorial

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

X, Y = (int(i) for i in input().split())

i = (2*X-Y)//3
j = (2*Y-X)//3

if(  ((2*X-Y)%3)!=0 or (2*Y-X)%3!=0  ):
    print(0)
else:
    print(combinations_count(i+j, i))


### FIXED CODE ###

import math

# 有理数型をインポート

# 組合せの総数
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n
 
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
 
    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
 
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
 
    return result


X, Y = (int(i) for i in input().split())

i = (2*X-Y)//3
j = (2*Y-X)//3

if(  i < 0 or j < 0 or (2*X-Y)%3!=0 or (2*Y-X)%3!=0 ):
    print(0)
else:
    print(cmb(i+j, i) % 1000000007)
N, H = map(int, input().split())
a = [0] * N
b = [0] * N
for i in range(N):
    a[i], b[i] = map(int, input().split())

A = int(max(a))
B = [i for i in b if i > A]

B.sort(reverse=True)

Sum = 0

for i in range(len(B)):
    H -= B[i]
    Sum += 1
    if H <= 0:
        break

if H > 0:
    Sum += int((H-1)//A)+1


print(Sum)

### FIXED CODE ###

s=list(str(input()))
s[3]=str(int(s[3])+1)
print("".join(s))
# coding: UTF-8
from collections import deque
N, M = map(int,input().split())
p = {}
link = set()
q = {}

for u in range(1,N+1):
  q[u] = deque()

for j in range(M):
  L,R,D = map(int,input().split())
  link.add((L,R,D))
  q[L].append((R,D))
  q[R].append((L,-D))
  
def depthfirstsearch(start):
  while q[start]:
    target,d = q[start].pop()
    if target not in p:
      p[target] = p[start] + d
      depthfirstsearch(target)

for start in range(1,N+1):
  if start not in p:
    p[start] = 0
    depthfirstsearch(start)

for L,R,D in link:
  if p[R] != p[L] + D:
    print("No")
    yes = False
if yes:
  print("Yes")


### FIXED CODE ###

# coding: UTF-8
from collections import deque
N,M = map(int,input().split())
link = [ [] for _ in range(N+1)]
value = [ -1 for _ in range(N+1)]

for _ in range(M):
  L,R,D = map(int,input().split())
  link[L].append((R,D))
  link[R].append((L,-D))

searched = set()
queue = deque()
for u in range(N+1):
  if u not in searched:
    queue.append(u)
    searched.add(u)
    value[u] = 0
    while queue:
      v = queue.popleft()
      for w,d in link[v]:
        if w not in searched:
          value[w] = value[v] + d
          queue.append(w)
          searched.add(w)

#verification
for v in range(N+1):
  for w,d in link[v]:
    if value[w] != value[v] + d:
      print("No")
      exit()
print("Yes")
H, W, M = map(int,input().rstrip().split())
l = [[0 for i in range(H)] for j in range(W)]
r = [0]*H
c = [0]*W
max_r = 0
max_c = 0
r_i = []
c_j = []
for i in range(M):
    h, w = map(int,input().rstrip().split())
    l[w-1][h-1] = 1
    r[h-1] += 1
    if r[h-1]>max_r:
        max_r = r[h-1]
        r_i = [h-1]
    elif r[h-1]==max_r:
        r_i.append(h-1)
    c[w-1] += 1
    if c[w-1]>max_c:
        max_c = c[w-1]
        c_j = [w-1]
    elif c[h-1]==max_c:
        c_j.append(w-1)
ans = max_r+max_c-1
for i in r_i:
    for j in c_j:
        if l[j][i] == 0:
            ans = max_r+max_c
            break
    else:
        continue
    break
print(ans)

### FIXED CODE ###

H, W, M = map(int,input().rstrip().split())
bomb = []
r = [0]*H
c = [0]*W
max_r = 0
max_c = 0
r_i = []
c_j = []
r_num = 0
c_num = 0
for i in range(M):
    h, w = map(int,input().rstrip().split())
    bomb.append([h-1,w-1])
    r[h-1] += 1
    if r[h-1]>max_r:
        max_r = r[h-1]
        r_i = [h-1]
        r_num = 1
    elif r[h-1]==max_r:
        r_i.append(h-1)
        r_num += 1
    c[w-1] += 1
    if c[w-1]>max_c:
        max_c = c[w-1]
        c_j = [w-1]
        c_num = 1
    elif c[w-1]==max_c:
        c_j.append(w-1)
        c_num += 1
r_set = set(r_i)
c_set = set(c_j)
num = 0
for i in range(M):
    if bomb[i][0] in r_set:
        if bomb[i][1] in c_set:
            num += 1
if num<r_num*c_num:
    ans = max_r+max_c
else:
    ans = max_r+max_c-1
print(ans)
S=string(input())
T=string(input())
num = 0
for i in range(len(S)):
    if S[i] != T[i]:
        num= num+1
print(num)

### FIXED CODE ###

S=input()  
T=input()
num = 0
for i in range(len(S)):
	if S[i] != T[i]:
		num= num+1
print(num)
def meu_map(l):
    for i in range(len(l)):
        l[i] = int(l[i])


n = int(raw_input())
array = raw_input().split()

meu_map(array)

fatores = 0
for e in array:
    while e != 1:
        if e % 2 == 0:
            e /= 2
            fatores += 1
        else:
            break

print(fatores)

### FIXED CODE ###

n = int(input())
a = map(int, input().split())
 
cont = 0
 
for e in a:
    x = e
    while x % 2 == 0:
        x /= 2
        cont += 1
 
print(cont)
MOD = 10**9+7
n = 10**5
fac = [1]*(n+1)
rev = [1]*(n+1)
 
for i in range(1,n+1):
  fac[i] = i*fac[i-1]%MOD
  rev[i] = pow(fac[i], MOD-2, MOD)
 
comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD

r1, c1, r2, c2 = map(int, input().split())
w = r2 - r1
h = c2 - c1
X, Y = 0, 0
ans = comb(c1+r1, r1)
for i in range(c1+1, c2+1):
    ans += comb(i+r1, r1)
    X += (h-(i-(c1+1)))*comb(i+r1, r1)
for i in range(r1+1, r2+1):
    ans += comb(i+c1, c1)
    Y += (w-(i-(r1+1)))*comb(i+c1, c1)
ans += w*X+h*Y
ans %= MOD
print(ans)

### FIXED CODE ###

def solve():
    r1, c1, r2, c2 = map(int, input().split())

    MOD = 10**9+7
    n = r2+c2+2
    fac = [1]*(n+1)
    rev = [1]*(n+1)
    
    for i in range(1,n+1):
      fac[i] = i*fac[i-1]%MOD
      rev[i] = pow(fac[i], MOD-2, MOD)
    
    comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD

    def f(r, c):
        return comb(r+c+2, c+1)

    ans = f(r2, c2) - f(r2, c1-1) - f(r1-1, c2) + f(r1-1, c1-1)
    ans %= MOD

    print(ans)


if __name__ == "__main__":
    solve()
import functools  # Python3 
N,M = map(int,input().split())
x, y, z = [0] * N, [0] * N, [0] * N
for i in range(N):
	x[i], y[i], z[i] = map(int,input().split())

# N, M = 5, 3
# x = [1, -4, 7, -10, 13]
# y = [-2, 5, -8, 11, -14]
# z = [3, -6, -9, -12, 15]
ppp = [ x[i]+y[i]+z[i] for i in range(N)]
pmp = [ x[i]-y[i]+z[i] for i in range(N)]
ppm = [ x[i]+y[i]-z[i] for i in range(N)]
pmm = [ x[i]-y[i]-z[i] for i in range(N)]
mpp = [-x[i]+y[i]+z[i] for i in range(N)]
mpm = [-x[i]+y[i]-z[i] for i in range(N)]
mmp = [-x[i]-y[i]+z[i] for i in range(N)]
mmm = [-x[i]-y[i]-z[i] for i in range(N)]

MAX = 0
for lis in [ppp,pmp,ppm,pmm,mpp,mpm,mmp,mmm]:
	cur = functools.reduce(lambda x,y: x+y,filter(lambda t: t >= 0,lis))
	print(cur)
	if cur > MAX:
		MAX = cur
print(MAX)




### FIXED CODE ###

import functools  # Python3 
N,M = map(int,input().split())
x, y, z = [0] * N, [0] * N, [0] * N
for i in range(N):
	x[i], y[i], z[i] = map(int,input().split())

if M==0:
	print(0)
	exit()

ppp = functools.reduce(lambda x,y: x+y,sorted([ x[i]+y[i]+z[i] for i in range(N)])[-M:])
pmp = functools.reduce(lambda x,y: x+y,sorted([ x[i]-y[i]+z[i] for i in range(N)])[-M:])
ppm = functools.reduce(lambda x,y: x+y,sorted([ x[i]+y[i]-z[i] for i in range(N)])[-M:])
pmm = functools.reduce(lambda x,y: x+y,sorted([ x[i]-y[i]-z[i] for i in range(N)])[-M:])
mpp = functools.reduce(lambda x,y: x+y,sorted([-x[i]+y[i]+z[i] for i in range(N)])[-M:])
mpm = functools.reduce(lambda x,y: x+y,sorted([-x[i]+y[i]-z[i] for i in range(N)])[-M:])
mmp = functools.reduce(lambda x,y: x+y,sorted([-x[i]-y[i]+z[i] for i in range(N)])[-M:])
mmm = functools.reduce(lambda x,y: x+y,sorted([-x[i]-y[i]-z[i] for i in range(N)])[-M:])

MAX = 0
for lis in [ppp,pmp,ppm,pmm,mpp,mpm,mmp,mmm]:
	if lis  > MAX:
		MAX = lis
print(MAX)
import math

n = int(input())
print(int(2*n/math.gcd(2,n)))

### FIXED CODE ###

n = int(input())
if n%2==0:
    print(n)
else:
    print(int(2 * n))
a='101'.join(''.join(d[c]for c in e.strip())for e in sys.stdin)
l=len(a)+4
b=a.ljust(l//5*5,'0')
print(''.join("ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"[int(b[i:i+5],2)]for i in range(0,l,5)))


### FIXED CODE ###

import sys
d={' ':'101',"'":'000000',',':'000011','-':'10010001','.':'010001','?':'000001','A':'100101','B':'10011010','C':'0101','D':'0001','E':'110',
'F':'01001','G':'10011011','H':'010000','I':'0111','J':'10011000','K':'0110','L':'00100','M':'10011001','N':'10011110','O':'00101','P':'111',
'Q':'10011111','R':'1000','S':'00110','T':'00111','U':'10011100','V':'10011101','W':'000010','X':'10010010','Y':'10010011','Z':'10010000'}
for e in sys.stdin:
 a=''.join(d[c]for c in e[:-1])
 a+='0'*(-len(a)%5)
 print(''.join("ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"[int(a[i*5:i*5+5],2)]for i in range(len(a)//5)))
import numpy as np
import sys
sys.setrecursionlimit(100000)

directions = np.array([[1, 0], [0, 1], [-1, 0], [0, -1]])


def acinput():
    return list(map(int, input().split(" ")))


sys.setrecursionlimit(100000)


directions = [[1, 0], [0, 1], [-1, 0], [0, -1]]
directions = list(map(np.array, directions))


def acinput():
    return list(map(int, input().split(" ")))


N, K = acinput()
s = list(map(int, list(input())))

nums = [1]
for i in range(1, N):
    if s[i] == s[i-1]:
        nums[-1] += 1
    else:
        nums.append(1)

if s[0] != 1:
    nums.insert(0, 0)
nums_cs = np.cumsum(nums)

res = nums_cs[2*K]
# if len(nums_cs) > 1:
#     res = nums_cs[min(len(nums_cs)-1, 2*K-1)]
# else:
#     res = nums_cs[0]

for i in range(1,len(nums_cs)-2*K+1):
    if i % 2 == 0:
        #print(i)
        res = max(res, nums_cs[min(i+2*K,len(nums_cs)-1)]-nums_cs[i-1])


print(res)

### FIXED CODE ###


import numpy as np
import sys
sys.setrecursionlimit(100000)

directions = np.array([[1, 0], [0, 1], [-1, 0], [0, -1]])


def acinput():
    return list(map(int, input().split(" ")))


sys.setrecursionlimit(100000)


directions = [[1, 0], [0, 1], [-1, 0], [0, -1]]
directions = list(map(np.array, directions))


def acinput():
    return list(map(int, input().split(" ")))


N, K = acinput()
s = list(map(int, list(input())))

nums = [1]
for i in range(1, N):
    if s[i] == s[i-1]:
        nums[-1] += 1
    else:
        nums.append(1)

if s[0] != 1:
    nums.insert(0, 0)
nums_cs = np.cumsum(nums)

res = nums_cs[min(len(nums_cs)-1,2*K)]
# if len(nums_cs) > 1:
#     res = nums_cs[min(len(nums_cs)-1, 2*K-1)]
# else:
#     res = nums_cs[0]

for i in range(1,len(nums_cs)-2*K+1):
    if i % 2 == 0:
        #print(i)
        res = max(res, nums_cs[min(i+2*K,len(nums_cs)-1)]-nums_cs[i-1])


print(res)
a,b,c=list(map(lambda x:int(x), input().split()))
 print("Yes") if a+b>=c else print("No")

### FIXED CODE ###

a,b,c=list(map(lambda x:int(x), input().split()))
print("Yes") if a+b>=c else print("No")
import math
r = input()
a = r ** 2 * math.pi
c = r * 2 * math.pi

print("%5f" % (a),"%5f" % (c))

### FIXED CODE ###

import math
r = float(input())
a = r ** 2 * math.pi
c = r * 2 * math.pi

print("%5f" % (a),"%5f" % (c))
from collections import deque

H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int. input().split())
Ch, Cw, Dh, Dw = Ch-1, Cw-1, Dh-1, Dw-1

maze = [input() for _ in range(H)]
visit = [[-1] * W for _ in range(H)]
visit[Ch][Cw] = 0

DQ = deque([[Ch, Cw]])
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

while DQ:
  px, py = DQ.popleft()
  if px==Dh and py==Dw:
    print(visit[px][py])
    exit()
  
  for i in range(4):
    nx = px + dx[i]
    ny = py + dy[i]
    if 0<=nx<=H-1 and 0<=ny<=C-1 and maze[nx][ny]=="." and  (visit[nx][ny]>visit[px][py] or visit[nx][ny]==-1):
      visit[nx][ny] = visit[px][py]
      DQ.append([nx, ny])
    
  for i in range(-2, 3):
    for j in range(-2, 3):
      if i==j==0:
        continue
      nx = px + i
      ny = py + j
      if 0<=nx<=H-1 and 0<=ny<=C-1 and maze[nx][ny]=="." and visit[nx][ny]==-1:
        visit[nx][ny] = visit[px][py] + 1
        DQ.append([nx, ny])

print(-1)

### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
C = list(map(int, input().split()))
C = tuple([C[0]-1, C[1]-1])
D = tuple(map(int, input().split()))
D = tuple([D[0]-1, D[1]-1])
maze = [list(input()) for _ in range(h)]

visit = [[False]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if maze[i][j] == "#":
            visit[i][j] = True

DQ = deque([C])
DQ_warp = deque([])

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

ans = 0

while DQ or DQ_warp:
    while DQ:
        now = DQ.popleft()
        if now == D:
            print(ans)
            exit()
        x, y = now[0], now[1]
        if visit[x][y]:
            continue
        visit[x][y] = True
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0<=nx<=h-1 and 0<=ny<=w-1 and visit[nx][ny]==False:
                DQ.append(tuple([nx, ny]))

        for i in range(-2, 3):
            for j in range(-2, 3):
                if i == j == 0: continue
                nx = x + i
                ny = y + j
                if 0<=nx<=h-1 and 0<=ny<=w-1 and visit[nx][ny]==False:
                    DQ_warp.append(tuple([nx, ny]))

    if DQ_warp:
        DQ = DQ_warp.copy()
        DQ_warp = deque([])
        ans += 1

print(-1)
S = input()
ans = int()
for i in range(len(S)//2):
if S[i] != S[-(i + 1)]:
    ans += 1
print(ans)

### FIXED CODE ###

S = input()
ans = int()
for i in range(len(S)//2):
    if S[i] != S[-(i + 1)]:
        ans += 1
print(ans)
from itertools import accumulate

N,K=list(map(int,input().split(" ")))
S=input()
def solve():
    cnt=0
    l=[]
    prev = "1"
    for i in S:
        if prev ==i:
            cnt+=1
        else:
            l.append(cnt)
            cnt = 1
        prev =i
    l.append(cnt)
    if prev=="0":
        l.append("0")
    w = 2*K+1
    if len(l) <=w:
        return N
    acc=[0]+list(accumulate(l))
    ans = 0
    for i in range(0,len(l)-w+1,2):
        ans = max(ans,acc[w+i]-acc[i])

    return ans
print(solve())

### FIXED CODE ###

from itertools import accumulate

n, k = list(map(int, input().split()))
s = input()


def solve():
    l = []
    prev = '1'
    cnt = 0
    for c in s:
        if prev == c:
            cnt += 1
        else:
            l.append(cnt)
            cnt = 1
        prev = c
    l.append(cnt)
    if prev == '0':
        l.append(0)

    w = 2 * k + 1

    if len(l) <= w:
        return n

    acc = [0] + list(accumulate(l))
    ans = 0
    for i in range(0, len(l) - w + 1, 2):
        ans = max(ans, acc[i + w] - acc[i])
    return ans


print(solve())