In an attempt to escape the Mischievous Mess Makers' antics, Farmer John has abandoned his farm and is traveling to the other side of Bovinia. During the journey, he and his k cows have decided to stay at the luxurious Grand Moo-dapest Hotel. The hotel consists of n rooms located in a row, some of which are occupied.

Farmer John wants to book a set of k + 1 currently unoccupied rooms for him and his cows. He wants his cows to stay as safe as possible, so he wishes to minimize the maximum distance from his room to the room of his cow. The distance between rooms i and j is defined as |j - i|. Help Farmer John protect his cows by calculating this minimum possible distance.


-----Input-----

The first line of the input contains two integers n and k (1 ≤ k < n ≤ 100 000) — the number of rooms in the hotel and the number of cows travelling with Farmer John.

The second line contains a string of length n describing the rooms. The i-th character of the string will be '0' if the i-th room is free, and '1' if the i-th room is occupied. It is guaranteed that at least k + 1 characters of this string are '0', so there exists at least one possible choice of k + 1 rooms for Farmer John and his cows to stay in.


-----Output-----

Print the minimum possible distance between Farmer John's room and his farthest cow.


-----Examples-----
Input
7 2
0100100

Output
2

Input
5 1
01010

Output
2

Input
3 2
000

Output
1



-----Note-----

In the first sample, Farmer John can book room 3 for himself, and rooms 1 and 4 for his cows. The distance to the farthest cow is 2. Note that it is impossible to make this distance 1, as there is no block of three consecutive unoccupied rooms.

In the second sample, Farmer John can book room 1 for himself and room 3 for his single cow. The distance between him and his cow is 2.

In the third sample, Farmer John books all three available rooms, taking the middle room for himself so that both cows are next to him. His distance from the farthest cow is 1.

Difficulty: interview

Starter code:

Solutions:
ans = 1000000000
n, k = [int(i) for i in input().split()]
s = input()
l = len(s)
d = [k // 2, (k + 1) // 2]
nearl = [0] * n
nearr = [0] * n
last = 1000000000
for i in range(n):
    if s[i] == '0':
        last = i
    nearl[i] = last
for i in range(n - 1, -1, -1):
    if s[i] == '0':
        last = i
    nearr[i] = last
for i in d:
    itl = 0
    nf = 0
    itr = 0
    while s[itl] == '1':
        itl += 1
    cnt = 0
    nf = itl
    while cnt < i:
        cnt += 1
        nf += 1
        while s[nf] == '1':
            nf += 1
    cnt = 0
    itr = nf
    while cnt < k - i:
        cnt += 1
        itr += 1
        while s[itr] == '1':
            itr += 1
    while True:
        pos = (itr + itl) // 2
        pos1 = nearl[pos]
        ans = min(ans, max(pos1 - itl, itr - pos1))
        pos1 = nearr[pos]
        ans = min(ans, max(pos1 - itl, itr - pos1))
        itr += 1
        while itr < l and s[itr] == '1':
            itr += 1
        if itr == l:
            break
        itl += 1
        while s[itl] == '1':
            itl += 1
print(ans)

n, k = list(map(int, input().split()))
s = input()
prefixes = [0]
for i in range(n):
    prefixes.append(prefixes[i] + ((int(s[i])) + 1) % 2)
a = n
for i in range(n):
    if s[i] == '0':
        left = 0
        right = n
        while(right - left > 1):
            middle = (right + left) // 2
            if prefixes[min(n, 1 + i + middle)] - prefixes[max(0, i - middle)] > k:
                right = middle
            else:
                left = middle
        a = min(a, right)
print(a)

n, k = map(int, input().split())
rooms = input()
count = [0] * (n + 1)
for i in range(n):
    count[i] = count[i - 1]
    if rooms[i] == '0':
        count[i] += 1

ans = float('inf')
for i in range(n):
    l = 0
    r = n
    while l + 1 < r:
        m = (r + l) // 2
        if rooms[i] == '0' and (count[min(i + m, n - 1)] - count[max(-1, i - m - 1)]) > k:
            r = m
        else:
            l = m
    ans = min(r, ans)
print(ans)

n, k = map(int, input().split())
rooms = input()
count = [0] * (n + 1)
for i in range(n):
    count[i] = count[i - 1]
    if rooms[i] == '0':
        count[i] += 1

ans = float('inf')
for i in range(n):
    if rooms[i] != '0':
        continue
    l = 0
    r = max(n - 1 - i, i)
    while l + 1 < r:
        m = (r + l) // 2
        if count[min(i + m, n - 1)] - count[max(-1, i - m - 1)] > k:
            r = m
        else:
            l = m
    ans = min(r, ans)
print(ans)

from collections import deque
rooms_number, cows_number = list(map(int, input().split()))
rooms = input()
free_rooms = [i for i in range(rooms_number) if rooms[i] == '0']
def binary_search(left, right, item):
    nonlocal free_rooms
    while right - left > 1:
        center = left + (right - left)//2
        if free_rooms[center] > item:
            right = center
        else:
            left = center
    return left
min_distation_to_farthest_cow = 10**20
best_min_distation_to_farthest_cow = cows_number//2 + cows_number%2
for i in range(len(free_rooms) - cows_number):
    left = free_rooms[i]
    right = free_rooms[i + cows_number]
    center = left + (right - left)//2
    j = binary_search(i, i + cows_number, center)
    if free_rooms[j] == center:
        distation_to_farthest_cow = right - center
    else:
        distation_to_farthest_cow = min(right - free_rooms[j], free_rooms[j + 1] - left)
    if min_distation_to_farthest_cow > distation_to_farthest_cow:
        min_distation_to_farthest_cow = distation_to_farthest_cow
    if distation_to_farthest_cow == best_min_distation_to_farthest_cow:
        break
print(min_distation_to_farthest_cow)


def main():
    from bisect import bisect
    n, k = list(map(int, input().split()))
    l = [i for i, c in enumerate(input()) if c == "0"]
    l.append(n * 3)
    for i, j in enumerate(range(k, len(l) - 1)):
        lo, hi = l[i], l[j]
        m = bisect(l, (lo + hi) // 2)
        mid = l[m]
        a, b = mid - lo, hi - mid
        if a < b:
            a = b
        mid = l[m - 1]
        b, c = mid - lo, hi - mid
        if b < c:
            b = c
        if a > b:
            a = b
        if n > a:
            n = a
    print(n)


def __starting_point():
    main()

__starting_point()

n, k = [int(_) for _ in input().split()]
a = input()


def next_free(x):
    x += 1
    while x < n and a[x] == '1':
        x += 1
    return x


l = next_free(-1)
r = -1


k += 1
for _ in range(k):
    r = next_free(r)
i = l
dis = max(i-l, r-i)
next_i = next_free(i)
while True:
    cur_dis = max(i-l, r-i)
    next_dis = max(next_i - l, r - next_i)

    if cur_dis <= next_dis:
        break
    i = next_i
    dis = min(dis, next_dis)
    next_i = next_free(i)


while True:
    r = next_free(r)
    if r >= n:
        break
    l = next_free(l)
    if i < l:
        i = l
    prev_dis = max(i-l, r-i)
    dis = min(dis, prev_dis)
    m = next_free(i)
    while m <= r:
        cur_dis = max(m-l, r-m)
        if cur_dis >= prev_dis:
            break
        prev_dis = cur_dis
        i = m
        dis = min(dis, cur_dis)
        m = next_free(m)

print(dis)


# binary search the ANSWER!!
# choose an answer and check if it works
# array [i] keeps track of how many zeros are before it


n, k = [int(_) for _ in input().split()]
a = input()

k += 1
# size of n+1
f = [0] * (n+1)

f[1] = int(a[0] == '0')
for i in range(2, n+1):
    f[i] = f[i-1] + int(a[i-1] == '0')

# print(f)


def check(dis):
    for i in range(n):
        if a[i] == '0':
            left = max(i-dis, 0)
            right = min(i+dis, n-1)
            total = f[right+1] - f[left]
            # print(total)
            if total >= k:
                return True
    return False


l = 1
r = n - 1
while l < r:
    mid = (l + r) // 2
    # print(mid)
    if check(mid):
        # print(True)
        r = mid
    else:
        # print(False)
        l = mid + 1
print(l)


# binary search the ANSWER!!
# choose an answer and check if it works
# array [i] keeps track of how many zeros are before it


n, k = map(int, input().split())
t = [i for i, v in enumerate(input()) if v == '0']
s, i = n, 0
a, b = t[:2]
for l, r in zip(t, t[k:]):
    while max(r - a, a - l) > max(r - b, b - l): 
        i += 1
        a, b = t[i:i + 2]
    s = min(s, max(r - a, a - l))
print(s)

n, k = map(int, input().split())
t = [i for i, v in enumerate(input()) if v == '0']
s, m = n, 0
f = lambda m: max(r - t[m], t[m] - l)
for l, r in zip(t, t[k:]):
    while f(m) > f(m + 1): m += 1
    s = min(s, f(m))
print(s)

n, k = list(map(int, input().split()))
t = [i for i, v in enumerate(input()) if v == '0']
s, m = n, 0
f = lambda m: max(r - t[m], t[m] - l)
for l, r in zip(t, t[k:]):
    while f(m) > f(m + 1): m += 1
    s = min(s, f(m))
print(s)



def main():
    n,k = list(map(int, input().split()))
    cowLocations = input()
    #n,k = 7,2
    #cowLocations = "0100100"
    whereIsCow = []
    for i in range(len(cowLocations)):
        if cowLocations[i] == '0':
            whereIsCow.append(i)
    i = 0
    j = k
    fJohn = 0
    wic = len(whereIsCow)
    #print(whereIsCow)
    smallest = 1000000
    while i < wic and j < wic and fJohn < wic:
        maxDist = max(whereIsCow[j]-whereIsCow[fJohn],
                                   whereIsCow[fJohn]-whereIsCow[i])
        #print(maxDist)
        while fJohn <= j and max(whereIsCow[j]-whereIsCow[fJohn+1],
                                   whereIsCow[fJohn+1]-whereIsCow[i]) < maxDist:
            fJohn += 1
            maxDist = max(whereIsCow[j]-whereIsCow[fJohn],
                                   whereIsCow[fJohn]-whereIsCow[i])
        if maxDist < smallest:
            smallest = maxDist
        j += 1
        i += 1
    print(smallest)

def __starting_point():
    main()
    


__starting_point()

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

t = [i for i, v in enumerate(input()) if v == '0']

s, m = n, 0

f = lambda m: max(r - t[m], t[m] - l)

for l, r in zip(t, t[k:]):

    while f(m) > f(m + 1): m += 1

    s = min(s, f(m))

print(s)




# Made By Mostafa_Khaled


res = 1e9
def next(i):
    i+=1
    while(i < n and s[i] == '1'):
        i+=1
    return i

n,k = list(map(int, input().split()))
s = input()
l = next(-1)
m = l
r = l
for i in range(k):
    r = next(r)
  
while(r < n):
    while(max(m - l, r - m) > max(next(m) - l, r - next(m))):
        m = next(m)
    res = min(res, max(m - l, r - m))
    l = next(l)
    r = next(r)
print(res)


[n, k] = [int(x) for x in input().split()]

room_free = [bool(1-int(x)) for x in input()]

# maintain queue closest before
# maintain queue of closest after

# maintain two pointers (l, r)
# if l == 0 check

closest_before = []
closest_after = []

# note, he needs k+1 rooms

before = -1
for i in range(n):
    if room_free[i]:
        before = i
    closest_before.append(before)

after = 11**8
for i in range(n-1, -1, -1):
    if room_free[i]:
        after = i
    closest_after.append(after)
closest_after.reverse()


l = -1
r = -1
taken = 0
ans = 10**8


while True:
    if taken != k+1:
        r += 1
        if r >= n:
            break
        if room_free[r]:
            taken += 1
    else:
        l += 1
        if room_free[l]:

            mid = int((l+r)/2)
            # print(l, r, mid, closest_after[mid])
            ans = min(ans, closest_after[mid+1] - l, r - closest_before[mid])
            taken -= 1
print(ans)



import sys
input = sys.stdin.readline

def judge(i, x):
    return acc[min(n, i+x+1)]-acc[max(0, i-x)]>=k+1

def binary_search(i):
    l, r = 0, n
    
    while l<=r:
        mid = (l+r)//2
        
        if judge(i, mid):
            r = mid-1
        else:
            l = mid+1
    
    return l

n, k = map(int, input().split())
S = input()[:-1]
acc = [0]

for Si in S:
    acc.append(acc[-1]+(1 if Si=='0' else 0))

ans = n

for i in range(n):
    if S[i]=='0':
        ans = min(ans, binary_search(i))

print(ans)

n, k = [int(_) for _ in input().split()]
a = input()
k += 1
# size of n+1
f = [0] * (n+1)
 
f[1]=int(a[0]=='0')
for i in range(1,n+1):
    f[i]=f[i-1]+int(a[i-1]=='0')
 
#sprint(f)
def check(dis):
    for i in range(n):
      if a[i]=='0':
        left=max(i-dis,0)
        right=min(i+dis,n-1)
        if f[right+1]-f[left]>=k:return True
    return False
l=1
r=n
ans=n
while l<=r:
    mid=(l + r)// 2
    # print(mid)
    if check(mid):
        # print(True)
        ans=min(ans,mid)
        r=mid-1
        
    else:
        # print(False)
        l=mid+1
print(ans)
 
 


n, k = [int(_) for _ in input().split()]
a = input()
k += 1
# size of n+1
f = [0] * (n+1)
 
f[1]=int(a[0]=='0')
for i in range(1,n+1):
    f[i]=f[i-1]+int(a[i-1]=='0')
 
#sprint(f)
def check(dis):
    for i in range(n):
      if a[i]=='0':
        left=max(i-dis,0)
        right=min(i+dis,n-1)
        if f[right+1]-f[left]>=k:return True
    return False
l=1
r=n
ans=n
while l<=r:
    mid=(l + r)// 2
    # print(mid)
    if check(mid):
        # print(True)
        ans=min(ans,mid)
        r=mid-1
        
    else:
        # print(False)
        l=mid+1
print(ans)