import sys

input = sys.stdin.readline

from itertools import accumulate



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

A = tuple(map(int, input().split()))

for _ in range(k):

  C = [0]*n

  for i, a in enumerate(A):

    C[max(0, i-a)] += 1

    if i+a < n-1:

      C[i+a+1] -= 1

  A = tuple(accumulate(C))

  if min(A) == n:

    break

print((*A))
from itertools import accumulate

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

A = list(map(int, input().split()))

for _ in range(k):

  B = [0]*(n+1)

  for i, a in enumerate(A):

    B[max(i-a, 0)] += 1

    B[min(i+a+1, n)] -= 1

  A = list(accumulate(B))[:-1]

  if min(A) == n:

    break

print((*A))
import sys

input = sys.stdin.readline
from itertools import accumulate

n, k = list(map(int, input().split()))
A = tuple(map(int, input().split()))
for _ in range(k):
    C = [0] * n
    for i, a in enumerate(A):
        C[max(0, i - a)] += 1
        if i + a < n - 1:
            C[i + a + 1] -= 1
    A = tuple(accumulate(C))
    if min(A) == n:
        break
print((*A))

from itertools import accumulate

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
for _ in range(k):
    B = [0] * (n + 1)
    for i, a in enumerate(A):
        B[max(i - a, 0)] += 1
        B[min(i + a + 1, n)] -= 1
    A = list(accumulate(B))[:-1]
    if min(A) == n:
        break
print((*A))

-import sys - -input = sys.stdin.readline -A = tuple(map(int, input().split())) +A = list(map(int, input().split())) -    C = [0] * n +    B = [0] * (n + 1) -        C[max(0, i - a)] += 1 -        if i + a < n - 1: -            C[i + a + 1] -= 1 -    A = tuple(accumulate(C)) +        B[max(i - a, 0)] += 1 +        B[min(i + a + 1, n)] -= 1 +    A = list(accumulate(B))[:-1]