import numpy as np 

from numba import jit

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

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

a=np.array(a,np.int64)



@jit

def imo(a):

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

    for i in range(n):

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

        imos[min(n,i+a[i]+1)]-=1

    

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

    immo=np.cumsum(imos)

    return immo[:n]





for _ in range(min(k,41)):

    a=imo(a)

    

print((*a))

import numpy as np 

from numba import njit

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

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

a=np.array(a,np.int64)



@njit(cache=True)

def imo(a):

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

    for i in range(n):

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

        imos[min(n,i+a[i]+1)]-=1

    

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

    immo=np.cumsum(imos)

    return immo[:n]





for _ in range(min(k,41)):

    a=imo(a)

    

print((*a))

import numpy as np
from numba import jit

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


@jit
def imo(a):
    imos = np.zeros(n + 1, np.int64)
    for i in range(n):
        imos[max(0, i - a[i])] += 1
        imos[min(n, i + a[i] + 1)] -= 1
    immo = np.zeros(n + 1, np.int64)
    immo = np.cumsum(imos)
    return immo[:n]


for _ in range(min(k, 41)):
    a = imo(a)
print((*a))

import numpy as np
from numba import njit

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


@njit(cache=True)
def imo(a):
    imos = np.zeros(n + 1, np.int64)
    for i in range(n):
        imos[max(0, i - a[i])] += 1
        imos[min(n, i + a[i] + 1)] -= 1
    immo = np.zeros(n + 1, np.int64)
    immo = np.cumsum(imos)
    return immo[:n]


for _ in range(min(k, 41)):
    a = imo(a)
print((*a))

-from numba import jit +from numba import njit -@jit +@njit(cache=True)