# coding: utf-8

# Your code here!

import time

t1=time.time()

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

n,k=LI()

a=LI()



for _ in range(k):

    tab=[0]*(n)

    for i in range(n):

        q=a[i]

        if 0<=i-q:

            tab[i-q]+=1

        else:

            tab[0]+=1

        if i+q+1<=n-1:

            tab[i+q+1]-=1

        else:

            pass

    b=[tab[0]]

    for i in range(n-1):

        b.append(tab[i+1]+b[-1])

    a=b[:]

    if time.time()-t1>1.5:

        print((*a))

        exit()

print((*a))

# coding: utf-8

# Your code here!

import time

t1=time.time()

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

n,k=LI()

a=LI()



for _ in range(k):

    tab=[0]*(n)

    for i in range(n):

        q=a[i]

        if 0<=i-q:

            tab[i-q]+=1

        else:

            tab[0]+=1

        if i+q+1<=n-1:

            tab[i+q+1]-=1

        else:

            pass

    b=[tab[0]]

    for i in range(n-1):

        b.append(tab[i+1]+b[-1])

    if a==b:

        print((*a))

        exit()

    a=b[:]

    if time.time()-t1>1.5:

        print((*a))

        exit()

print((*a))

# coding: utf-8
# Your code here!
import time

t1 = time.time()


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


n, k = LI()
a = LI()
for _ in range(k):
    tab = [0] * (n)
    for i in range(n):
        q = a[i]
        if 0 <= i - q:
            tab[i - q] += 1
        else:
            tab[0] += 1
        if i + q + 1 <= n - 1:
            tab[i + q + 1] -= 1
        else:
            pass
    b = [tab[0]]
    for i in range(n - 1):
        b.append(tab[i + 1] + b[-1])
    a = b[:]
    if time.time() - t1 > 1.5:
        print((*a))
        exit()
print((*a))

# coding: utf-8
# Your code here!
import time

t1 = time.time()


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


n, k = LI()
a = LI()
for _ in range(k):
    tab = [0] * (n)
    for i in range(n):
        q = a[i]
        if 0 <= i - q:
            tab[i - q] += 1
        else:
            tab[0] += 1
        if i + q + 1 <= n - 1:
            tab[i + q + 1] -= 1
        else:
            pass
    b = [tab[0]]
    for i in range(n - 1):
        b.append(tab[i + 1] + b[-1])
    if a == b:
        print((*a))
        exit()
    a = b[:]
    if time.time() - t1 > 1.5:
        print((*a))
        exit()
print((*a))

+    if a == b: +        print((*a)) +        exit()