
function main(input) {
    let [N, K, ...A] = input.split(/[\s\n]/).map(Number)

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

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

        A = imos
    }

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

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