import sys



def main():

    input = sys.stdin.readline

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

    a = [int(x) for x in input().split()]

    key = 50

    nn = n

    while nn > 0:

        key += 1

        nn //= 2

    

    for _ in range(min([key, k])):

        b = [0]*n

        for i in range(n):

            l, r = max([i-a[i], 0]), min([i+a[i], n-1])

            b[l] += 1

            if r != n-1:

                b[r+1] -= 1

        for i in range(n):

            a[i] = 0

            a[i] += b[i]

            if i != 0:

                 a[i] += a[i-1]

    print((*a))



if __name__ == "__main__":

    main()

import sys



def main():

    input = sys.stdin.readline

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

    a = [int(x) for x in input().split()]

    key = 30

    nn = n

    while nn > 0:

        key += 1

        nn //= 2

    

    for _ in range(min([key, k])):

        b = [0]*n

        for i in range(n):

            l, r = max([i-a[i], 0]), min([i+a[i], n-1])

            b[l] += 1

            if r != n-1:

                b[r+1] -= 1

        for i in range(n):

            a[i] = 0

            a[i] += b[i]

            if i != 0:

                 a[i] += a[i-1]

    print((*a))



if __name__ == "__main__":

    main()



import sys


def main():
    input = sys.stdin.readline
    n, k = list(map(int, input().split()))
    a = [int(x) for x in input().split()]
    key = 50
    nn = n
    while nn > 0:
        key += 1
        nn //= 2
    for _ in range(min([key, k])):
        b = [0] * n
        for i in range(n):
            l, r = max([i - a[i], 0]), min([i + a[i], n - 1])
            b[l] += 1
            if r != n - 1:
                b[r + 1] -= 1
        for i in range(n):
            a[i] = 0
            a[i] += b[i]
            if i != 0:
                a[i] += a[i - 1]
    print((*a))


if __name__ == "__main__":
    main()

import sys


def main():
    input = sys.stdin.readline
    n, k = list(map(int, input().split()))
    a = [int(x) for x in input().split()]
    key = 30
    nn = n
    while nn > 0:
        key += 1
        nn //= 2
    for _ in range(min([key, k])):
        b = [0] * n
        for i in range(n):
            l, r = max([i - a[i], 0]), min([i + a[i], n - 1])
            b[l] += 1
            if r != n - 1:
                b[r + 1] -= 1
        for i in range(n):
            a[i] = 0
            a[i] += b[i]
            if i != 0:
                a[i] += a[i - 1]
    print((*a))


if __name__ == "__main__":
    main()

-    key = 50 +    key = 30