import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N, K = mapint()

now = list(mapint())

from itertools import accumulate

iteration = min(N.bit_length()*4, K)

for k in range(iteration):

    nx = [0]*N

    for i, a in enumerate(now):

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

        if i+a+1<N:

            nx[i+a+1] -= 1

    nx = list(accumulate(nx))

    now = nx[:]

print((*now))
import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N, K = mapint()

As = list(mapint())

from itertools import accumulate



for _ in range(K):

    lamps = [0]*N

    for i, a in enumerate(As):

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

        if i+a+1<=N-1:

            lamps[i+a+1] -= 1

    As = list(accumulate(lamps))

    if sum(As)==N**2:

        break

print((*As))
import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N, K = mapint()
now = list(mapint())
from itertools import accumulate

iteration = min(N.bit_length() * 4, K)
for k in range(iteration):
    nx = [0] * N
    for i, a in enumerate(now):
        nx[max(0, i - a)] += 1
        if i + a + 1 < N:
            nx[i + a + 1] -= 1
    nx = list(accumulate(nx))
    now = nx[:]
print((*now))

import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N, K = mapint()
As = list(mapint())
from itertools import accumulate

for _ in range(K):
    lamps = [0] * N
    for i, a in enumerate(As):
        lamps[max(0, i - a)] += 1
        if i + a + 1 <= N - 1:
            lamps[i + a + 1] -= 1
    As = list(accumulate(lamps))
    if sum(As) == N**2:
        break
print((*As))

-now = list(mapint()) +As = list(mapint()) -iteration = min(N.bit_length() * 4, K) -for k in range(iteration): -    nx = [0] * N -    for i, a in enumerate(now): -        nx[max(0, i - a)] += 1 -        if i + a + 1 < N: -            nx[i + a + 1] -= 1 -    nx = list(accumulate(nx)) -    now = nx[:] -print((*now)) +for _ in range(K): +    lamps = [0] * N +    for i, a in enumerate(As): +        lamps[max(0, i - a)] += 1 +        if i + a + 1 <= N - 1: +            lamps[i + a + 1] -= 1 +    As = list(accumulate(lamps)) +    if sum(As) == N**2: +        break +print((*As))