import numpy as np

from numba import njit, i8



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

arr = np.array(list(map(int, input().split())))





@njit(i8[:](i8, i8, i8[:]), cache=True)

def solve(n, k, arr):

    for i in range(min(k, 50)):

        tmp_arr = np.zeros(n + 2, np.int64)

        for i, power in enumerate(arr):

            tmp_arr[max(0, i - power + 1)] += 1

            tmp_arr[min(n + 1, i + power + 2)] -= 1

        arr = np.cumsum(tmp_arr)[1:-1]

    return arr





print((*solve(n, k, arr)))
import numpy as np

from numba import njit, i8



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

arr = np.array(list(map(int, input().split())))





@njit(i8[:](i8, i8, i8[:]), cache=True)

def solve(n, k, arr):

    for i in range(min(k, 50)):

        tmp_arr = np.zeros(n + 1, np.int64)

        for i, power in enumerate(arr):

            tmp_arr[max(0, i - power)] += 1

            tmp_arr[min(n, i + power + 1)] -= 1

        arr = np.cumsum(tmp_arr)[:-1]

    return arr





print((*solve(n, k, arr)))
import numpy as np
from numba import njit, i8

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


@njit(i8[:](i8, i8, i8[:]), cache=True)
def solve(n, k, arr):
    for i in range(min(k, 50)):
        tmp_arr = np.zeros(n + 2, np.int64)
        for i, power in enumerate(arr):
            tmp_arr[max(0, i - power + 1)] += 1
            tmp_arr[min(n + 1, i + power + 2)] -= 1
        arr = np.cumsum(tmp_arr)[1:-1]
    return arr


print((*solve(n, k, arr)))

import numpy as np
from numba import njit, i8

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


@njit(i8[:](i8, i8, i8[:]), cache=True)
def solve(n, k, arr):
    for i in range(min(k, 50)):
        tmp_arr = np.zeros(n + 1, np.int64)
        for i, power in enumerate(arr):
            tmp_arr[max(0, i - power)] += 1
            tmp_arr[min(n, i + power + 1)] -= 1
        arr = np.cumsum(tmp_arr)[:-1]
    return arr


print((*solve(n, k, arr)))

-        tmp_arr = np.zeros(n + 2, np.int64) +        tmp_arr = np.zeros(n + 1, np.int64) -            tmp_arr[max(0, i - power + 1)] += 1 -            tmp_arr[min(n + 1, i + power + 2)] -= 1 -        arr = np.cumsum(tmp_arr)[1:-1] +            tmp_arr[max(0, i - power)] += 1 +            tmp_arr[min(n, i + power + 1)] -= 1 +        arr = np.cumsum(tmp_arr)[:-1]