Buggy python submission (verdict: Runtime Error):
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import numpy as np

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    arr=list(map(int, readline().rstrip().split()))
    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        sm=tmp[0]
        arr[0]=tmp[0]
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
            sm+=abs(tmp[i])
        if tmp[0]==n and sm==n:
            break
    print(" ".join(map(str,arr)))
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Fixed submission:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    arr=list(map(int, readline().rstrip().split()))
    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        sm=tmp[0]
        arr[0]=tmp[0]
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
            sm+=abs(tmp[i])
        if tmp[0]==n and sm==n:
            break
    print(" ".join(map(str,arr)))
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Buggy python submission (verdict: Time Limit Exceeded):
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import numpy as np

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    arr=list(map(int, readline().rstrip().split()))
    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        sm=tmp[0]
        arr[0]=tmp[0]
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
            sm+=tmp[i]
        if tmp[0]==n and sm==n:
            break
    print(" ".join(map(str,arr)))
    return

    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    k=4

    sp = k

    for _ in range(1):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i] - sp
            y = i + arr[i] + 1 + sp
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        arr[0]=tmp[0]
        print(tmp)
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
    print(" ".join(map(str,arr)))

    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    k=10


    return


    xxx="2 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0"
    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    k=10

    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y>n:
                y=n
            for j in range(x,y):
                tmp[j]+=1
        arr=tmp
        print(arr)

    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    print("---")
    tmp=[0]*n
    for i in range(n):
        x = i - arr[i]
        y = i + arr[i] + 1
        if x<0:
            x=0
        if y>n:
            y=n
        for j in range(x,y):
            tmp[j]+=1
    arr=tmp
    print(arr)
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)

    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    print("---")
    tmp=[0]*n
    for i in range(n):
        x = i - arr[i]
        y = i + arr[i] + 1
        if x<0:
            x=0
        if y<n:
            tmp[y]-=1
        tmp[x]+=1
    arr=list(np.cumsum(tmp))
    print(arr)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Fixed submission:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    arr=list(map(int, readline().rstrip().split()))
    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        sm=tmp[0]
        arr[0]=tmp[0]
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
            sm+=abs(tmp[i])
        if tmp[0]==n and sm==n:
            break
    print(" ".join(map(str,arr)))
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Buggy python submission (verdict: Time Limit Exceeded):
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import numpy as np

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

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

    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        arr[0]=tmp[0]
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
    print(" ".join(map(str,arr)))
    return

    xxx="2 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0"
    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    k=10

    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y>n:
                y=n
            for j in range(x,y):
                tmp[j]+=1
        arr=tmp
        print(arr)

    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    print("---")
    tmp=[0]*n
    for i in range(n):
        x = i - arr[i]
        y = i + arr[i] + 1
        if x<0:
            x=0
        if y>n:
            y=n
        for j in range(x,y):
            tmp[j]+=1
    arr=tmp
    print(arr)
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)

    arr=list(map(int, xxx.rstrip().split()))
    n=len(arr)
    print("---")
    tmp=[0]*n
    for i in range(n):
        x = i - arr[i]
        y = i + arr[i] + 1
        if x<0:
            x=0
        if y<n:
            tmp[y]-=1
        tmp[x]+=1
    arr=list(np.cumsum(tmp))
    print(arr)
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Fixed submission:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    arr=list(map(int, readline().rstrip().split()))
    for _ in range(k):
        tmp=[0]*n
        for i in range(n):
            x = i - arr[i]
            y = i + arr[i] + 1
            if x<0:
                x=0
            if y<n:
                tmp[y]-=1
            tmp[x]+=1
        sm=tmp[0]
        arr[0]=tmp[0]
        for i in range(1,n):
            arr[i]=arr[i-1]+tmp[i]
            sm+=abs(tmp[i])
        if tmp[0]==n and sm==n:
            break
    print(" ".join(map(str,arr)))
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------