function main(input) {
  let args = input.split('\n');
  let x = 0;
  let [n, k] = args[x++].split(' ');
  let a = args[x++].split(' ').map((e) => +e);
  for (let i = 0; i < k; ++i) {
    let b = new Array(+n).fill(0);
    for (let j = 0; j < n; ++j) {
      let l = Math.max(0, j - a[j]);
      let r = Math.min(+n - 1, j + a[j]);
      b[l]++;
      if (r + 1 < n) b[r + 1]--;
    }
    a = b;
    for (let i = 1; i < n; i++) a[i] += a[i - 1];
  }
  console.log(a.join(' '));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
