function main(input) {
  const [n, k] = input[0].trim().split(" ").map(i => parseInt(i));
  let a = input[1].trim().split(" ").map(i => parseInt(i));

  for(let j=0;j<k;j++){
    const b = new Array(n).fill(0);
    for(let i=0;i<n;i++){
      let index = i-a[i];
      while(index<=i+a[i]){
        if((index>=0) && (index<n)){
          b[index]++;
        }
        index++;
      }
    }
    a = b;
  }
  console.log(a.join(" "));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));