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

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

for k in range(41):

    B = [0] * N

    for i, a in enumerate(A):

        l = max(0, i - a)

        r = min(N - 1, i + a)

        B[l] += 1

        if r + 1 < N: B[r + 1] -= 1

    for i in range(1, N): B[i] += B[i-1]

    A = B

    if k == K - 1: break

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

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

for _ in range(min(K, 50)):

    counter = [0] * (N+2)

    for i, a in enumerate(A, 1):

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

        counter[min(N + 1, i + a + 1)] += -1

    for i in range(1, len(counter) - 1):

        counter[i] += counter[i-1]

    A = counter[1:N+1]

print((*A))

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

N, K = list(map(int, input().split()))
(*A,) = list(map(int, input().split()))
for _ in range(min(K, 50)):
    counter = [0] * (N + 2)
    for i, a in enumerate(A, 1):
        counter[max(0, i - a)] += 1
        counter[min(N + 1, i + a + 1)] += -1
    for i in range(1, len(counter) - 1):
        counter[i] += counter[i - 1]
    A = counter[1 : N + 1]
print((*A))

-for k in range(41): -    B = [0] * N -    for i, a in enumerate(A): -        l = max(0, i - a) -        r = min(N - 1, i + a) -        B[l] += 1 -        if r + 1 < N: -            B[r + 1] -= 1 -    for i in range(1, N): -        B[i] += B[i - 1] -    A = B -    if k == K - 1: -        break +for _ in range(min(K, 50)): +    counter = [0] * (N + 2) +    for i, a in enumerate(A, 1): +        counter[max(0, i - a)] += 1 +        counter[min(N + 1, i + a + 1)] += -1 +    for i in range(1, len(counter) - 1): +        counter[i] += counter[i - 1] +    A = counter[1 : N + 1]