import sys

from itertools import accumulate

input=sys.stdin.buffer.readline

def main():

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

    a=[*list(map(int,input().split()))]

    for _ in'_'*k:

        b=[0]*n

        for i,t in enumerate(a):

            if i>t:b[i-t]+=1

            else:b[0]+=1

            j=i-~t

            if j<n:b[j]-=1

        a=[*accumulate(b)]

        if min(a)==n:break

    print((' '.join(map(str,a))))

main()
n,k,*a=list(map(int,open(0).read().split()))

r=list(range(n))

for _ in a[:k][:41]:

 b=[0]*n*3

 for i in r:b[max(0,i-a[i])]+=1;b[i-~a[i]]-=1

 for i in r:b[i+1]+=b[i]

 a=b

print((*a[:n]))
import sys
from itertools import accumulate

input = sys.stdin.buffer.readline


def main():
    n, k = list(map(int, input().split()))
    a = [*list(map(int, input().split()))]
    for _ in "_" * k:
        b = [0] * n
        for i, t in enumerate(a):
            if i > t:
                b[i - t] += 1
            else:
                b[0] += 1
            j = i - ~t
            if j < n:
                b[j] -= 1
        a = [*accumulate(b)]
        if min(a) == n:
            break
    print((" ".join(map(str, a))))


main()

n, k, *a = list(map(int, open(0).read().split()))
r = list(range(n))
for _ in a[:k][:41]:
    b = [0] * n * 3
    for i in r:
        b[max(0, i - a[i])] += 1
        b[i - ~a[i]] -= 1
    for i in r:
        b[i + 1] += b[i]
    a = b
print((*a[:n]))

-import sys -from itertools import accumulate - -input = sys.stdin.buffer.readline - - -def main(): -    n, k = list(map(int, input().split())) -    a = [*list(map(int, input().split()))] -    for _ in "_" * k: -        b = [0] * n -        for i, t in enumerate(a): -            if i > t: -                b[i - t] += 1 -            else: -                b[0] += 1 -            j = i - ~t -            if j < n: -                b[j] -= 1 -        a = [*accumulate(b)] -        if min(a) == n: -            break -    print((" ".join(map(str, a)))) - - -main() +n, k, *a = list(map(int, open(0).read().split())) +r = list(range(n)) +for _ in a[:k][:41]: +    b = [0] * n * 3 +    for i in r: +        b[max(0, i - a[i])] += 1 +        b[i - ~a[i]] -= 1 +    for i in r: +        b[i + 1] += b[i] +    a = b +print((*a[:n]))