import math

from sys import stdin,stdout

#% 998244353

from heapq import heapify,heappop,heappush

import collections



n,k=list(map(int,stdin.readline().split()))

a=list(map(int,stdin.readline().split()))





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

    #nw=[0]*n

    pr=[0]*n

    for x,d in enumerate(a):

        if d==0:

            pr[x]+=1

            if x!=n-1:

                pr[x+1]-=1

            continue

        l=math.floor(x-d)

        r=math.floor(x+d)

        l=max(0,l)

        r=min(n-1,r)

        pr[l]+=1

        if r!=n-1:

            pr[r+1]-=1

    

    for m in range(1,n):

        pr[m]+=pr[m-1]

    

    a[:]=pr





        



for i in a:

    print(i,end=" ")

import math

from sys import stdin,stdout

#% 998244353

from heapq import heapify,heappop,heappush

import collections



n,k=list(map(int,stdin.readline().split()))

a=list(map(int,stdin.readline().split()))





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

    #nw=[0]*n

    pr=[0]*n

    for x,d in enumerate(a):

        if d==0:

            pr[x]+=1

            if x!=n-1:

                pr[x+1]-=1

            continue

        l=math.floor(x-d)

        r=math.floor(x+d)

        l=max(0,l)

        r=min(n-1,r)

        pr[l]+=1

        if r!=n-1:

            pr[r+1]-=1

    

    for m in range(1,n):

        pr[m]+=pr[m-1]

    

    a[:]=pr





        



for i in a:

    print(i,end=" ")

import math
from sys import stdin, stdout

#% 998244353
from heapq import heapify, heappop, heappush
import collections

n, k = list(map(int, stdin.readline().split()))
a = list(map(int, stdin.readline().split()))
for i in range(min(k, 100)):
    # nw=[0]*n
    pr = [0] * n
    for x, d in enumerate(a):
        if d == 0:
            pr[x] += 1
            if x != n - 1:
                pr[x + 1] -= 1
            continue
        l = math.floor(x - d)
        r = math.floor(x + d)
        l = max(0, l)
        r = min(n - 1, r)
        pr[l] += 1
        if r != n - 1:
            pr[r + 1] -= 1
    for m in range(1, n):
        pr[m] += pr[m - 1]
    a[:] = pr
for i in a:
    print(i, end=" ")

import math
from sys import stdin, stdout

#% 998244353
from heapq import heapify, heappop, heappush
import collections

n, k = list(map(int, stdin.readline().split()))
a = list(map(int, stdin.readline().split()))
for i in range(min(k, 42)):
    # nw=[0]*n
    pr = [0] * n
    for x, d in enumerate(a):
        if d == 0:
            pr[x] += 1
            if x != n - 1:
                pr[x + 1] -= 1
            continue
        l = math.floor(x - d)
        r = math.floor(x + d)
        l = max(0, l)
        r = min(n - 1, r)
        pr[l] += 1
        if r != n - 1:
            pr[r + 1] -= 1
    for m in range(1, n):
        pr[m] += pr[m - 1]
    a[:] = pr
for i in a:
    print(i, end=" ")

-for i in range(min(k, 100)): +for i in range(min(k, 42)):