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