
function main(input) {
    const [NK, As] = input.trim().split('\n')
    let [N, K] = NK.split(' ').map(n => Number(n))
    let A = As.split(' ').map(n => Number(n))

    for(let k = 0; k < K; k++) {
        const imos = new Array(N).fill(0)

        for(let i = 0; i < N; i++) {
            let [min, max] = [i - A[i], i + A[i] + 1]
            if(min < 0) min = 0
            imos[min]++
            imos[max]--
        }
        imos.length = N

        const newA = new Array(N).fill(0)
        let cur = 0
        for(let i = 0; i < N; i++) {
            cur += imos[i]
            newA[i] = cur
        }
        
        const is_same = A.every((a,i) => a === newA[i])
        if(is_same) break
        
        A = newA
    }

    console.log(A.join(' '))
}

main(require("fs").readFileSync("/dev/stdin", "utf8"))
