N, K= list(map(int,input().split()))

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

a=A[:]

for _ in range(K):

  B=[0]*(N+1)

  for i in range(N):

    t = a[i]

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

    B[min(i+t+1,N)] -=1

  for i in range(N):

    B[i+1] += B[i]

  a=B[:N]        

  if min(a)==N:

    break

print((*a))
N, K= list(map(int,input().split()))

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

#a=A[:]

for _ in range(K):

  B=[0]*(N+1)

  for i in range(N):

    t = a[i]

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

    B[min(i+t+1,N)] -=1

  for i in range(N):

    B[i+1] += B[i]

  a=B[:N]        

  if min(a)==N:

    break

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

N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
# a=A[:]
for _ in range(K):
    B = [0] * (N + 1)
    for i in range(N):
        t = a[i]
        B[max(i - t, 0)] += 1
        B[min(i + t + 1, N)] -= 1
    for i in range(N):
        B[i + 1] += B[i]
    a = B[:N]
    if min(a) == N:
        break
print((*a))

-A = list(map(int, input().split())) -a = A[:] +a = list(map(int, input().split())) +# a=A[:]