console.log(function(args){
  let [[N,K],A] = args.trim().split('\n').map( r=>r.split(' ').map(v=>v|0) );
  const N0 = Array(N).fill(0);
  for ( let i = 0; i < K; i++ ) {
    const B = [].concat(N0);
    for ( let j = 0; j < N; j++ ) {
      const min = Math.max( 0, j - A[j] );
      const max = Math.min( N-1, j + A[j] );
      for ( let k = min; k <= max; k++ ) B[k]++;
    }
    A = B;
  }
  return A.join(' ');
}(require('fs').readFileSync('/dev/stdin', 'utf8')));
