"use strict"
function main(arg) {
    let [N,K] = arg.trim().split("\n")[0].split(" ").map(Number)
    let A = arg.trim().split("\n")[1].split(" ").map(Number)
    for (let i = 0; i < K; i++) {
        let B = new Array(N).fill(0)
        for (let x = 0; x < N; x++) {
            let d = A[x]
            let l = x - d - 0.5 
            l = l < 0 ? 0 : l
            let r = x + d + 0.5
            r = r > (N-1) ? N-1 : r
            l = Math.ceil(l)
            r = Math.floor(r)
            // console.log([l,r])
            for (let j = l; j <= r; j++) {
                B[j] += 1
            }
        }
        if (A.join("") === B.join("")) {
            break
        }
        A = B
    }
    console.log(A.join(" "))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));