function Main(input) {
 
	// 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
  
    let N = parseInt(input[0].split(" ")[0]);
    let K = parseInt(input[0].split(" ")[1]);
    
    let d = input[1].split(" ").map(v => parseInt(v));
    
    for (let i = 1; i <= K; i++) d = make_d(d);
    
    console.log(d.join(" "));
}

function make_d(d){
    
    let b_i = (new Array(d.length)).fill(0);
  let len = d.length;
        
    d.forEach((value, index) => {
        
        let x = index + 1;
        let d_min = (x - value - 0.5) | 0;
        let d_max = (x + value + 0.5) | 0;
        
        for (let i = d_min; i <= d_max && i <= len; i++) b_i[i - 1] += 1;
        
    });
    
    return b_i;
    
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));