import kotlin.math.*
import java.util.*

const val MOD = 1_000_000_007L

fun readI() = readLine()!!.toInt()
fun readL() = readLine()!!.toLong()
fun readD() = readLine()!!.toDouble()
fun readIs() = readLine()!!.split(' ').map(String::toInt)
fun readLs() = readLine()!!.split(' ').map(String::toLong)
fun readDs() = readLine()!!.split(' ').map(String::toDouble)

fun main(args: Array<String>) {
  val (n, k) = readIs()
  var a = readIs().toIntArray()
  for (i in 1..k) {
    val b = IntArray(n)
    for (j in 0 until n) {
      val p = max(0, j - a[j])
      val q = j + a[j] + 1
      b[p]++
      if (q < n) b[q]--
    }
    for (j in 1 until n) {
      b[j] = b[j - 1] + b[j]
    }
    if (Arrays.equals(a, b)) break
    a = b
  }
  a.forEach {
    print(it)
    print(' ')
  }
  println()
}
