"use strict";

const main = arg => {
    const input = arg.trim().split("\n");

    const [N, K] = input[0].split(" ").map(el => parseInt(el));
    let As = input[1].split(" ").map(el => parseInt(el));
    for(let k = 0; k<K; k++){
        let tmp = new Array(N).fill(0)
        for(let i = 0; i< N; i++){
            const d = As[i]
            if(d === 0){
                tmp[i]++
            } else {
                for(let j = i-d; j<=i+d; j++){
                    if(j < 0 || j>=N) continue
                    tmp[j]++
                }
            }
        }
        As = [...tmp]
    }
    console.log(As.join(" "))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  
