function Main (input) {
  let n = input.split("\n")[0].split(" ")[0];
  let k = input.split("\n")[0].split(" ")[1];
  let a = input.split("\n")[1];
  
  let b = new Array(n);
  b.fill(0);
  
  for (let i = 0; i < k; i++) {
    for (let j = 0; j < n; j++) {
      for (let m = j - a[j]; m <= j + a[j]; m++) {
        if (m < 0 || m == a[j]) continue;
        b[m]++;
      }
    }
    
    for (let j = 0; j < n; j++) a[j] = b[j];
    
    b.fill(0);
  }
  
  console.log(a);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
