# coding: utf-8

import numpy as np

from numba import b1, i8, njit, types





@njit(types.Tuple((i8[:], b1))(i8[:]), cache=True)

def f(A):

    n = len(A)

    ret = np.zeros_like(A)

    for x, p in enumerate(A):

        ret[max(0, x-p)] += 1

        if x+p+1 < n:

            ret[x+p+1] -= 1

    ret = ret.cumsum()

    return ret, np.all(A == n)





def solve(*args: str) -> str:

    n, k = list(map(int, args[0].split()))

    A = np.array(tuple(map(int, args[1].split())), int)

    for _ in range(k):

        A, satulated = f(A)

        if satulated:

            break



    return ' '.join(map(str, A))





if __name__ == "__main__":

    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8

import numpy as np

from numba import b1, i8, njit, types





@njit(types.Tuple((i8[:], b1))(i8[:]), cache=True)

def f(A):

    n = len(A)

    ret = np.zeros_like(A)

    for x, p in enumerate(A):

        ret[max(0, x-p)] += 1

        if x+p+1 < n:

            ret[x+p+1] -= 1



    satulated = True

    for i in range(1, n):

        ret[i] += ret[i-1]

        satulated &= ret[i] == n

    return ret, satulated





def solve(*args: str) -> str:

    n, k = list(map(int, args[0].split()))

    A = np.array(tuple(map(int, args[1].split())))



    for _ in range(k):

        A, satulated = f(A)

        if satulated:

            break



    return ' '.join(map(str, A))





if __name__ == "__main__":

    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8
import numpy as np
from numba import b1, i8, njit, types


@njit(types.Tuple((i8[:], b1))(i8[:]), cache=True)
def f(A):
    n = len(A)
    ret = np.zeros_like(A)
    for x, p in enumerate(A):
        ret[max(0, x - p)] += 1
        if x + p + 1 < n:
            ret[x + p + 1] -= 1
    ret = ret.cumsum()
    return ret, np.all(A == n)


def solve(*args: str) -> str:
    n, k = list(map(int, args[0].split()))
    A = np.array(tuple(map(int, args[1].split())), int)
    for _ in range(k):
        A, satulated = f(A)
        if satulated:
            break
    return " ".join(map(str, A))


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8
import numpy as np
from numba import b1, i8, njit, types


@njit(types.Tuple((i8[:], b1))(i8[:]), cache=True)
def f(A):
    n = len(A)
    ret = np.zeros_like(A)
    for x, p in enumerate(A):
        ret[max(0, x - p)] += 1
        if x + p + 1 < n:
            ret[x + p + 1] -= 1
    satulated = True
    for i in range(1, n):
        ret[i] += ret[i - 1]
        satulated &= ret[i] == n
    return ret, satulated


def solve(*args: str) -> str:
    n, k = list(map(int, args[0].split()))
    A = np.array(tuple(map(int, args[1].split())))
    for _ in range(k):
        A, satulated = f(A)
        if satulated:
            break
    return " ".join(map(str, A))


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))

-    ret = ret.cumsum() -    return ret, np.all(A == n) +    satulated = True +    for i in range(1, n): +        ret[i] += ret[i - 1] +        satulated &= ret[i] == n +    return ret, satulated -    A = np.array(tuple(map(int, args[1].split())), int) +    A = np.array(tuple(map(int, args[1].split())))