import kotlin.math.max
import kotlin.math.min

fun main(args: Array<String>) = tokiomarine2020c()

fun tokiomarine2020c() {
    val (n, k) = readLine()!!.split(' ').map { it.toInt() }
    val aList = readLine()!!.split(' ').map { it.toInt() }

    var curr = aList.toIntArray()

    repeat(min(k, 50)) {
        val imos = IntArray(n + 1)

        curr.withIndex().forEach { (index, value) ->
            imos[max(index - value, 0)]++
            imos[min(index + value + 1, n)]--
        }

        for (i in 0 until n - 1) imos[i + 1] += imos[i]

        curr = imos.dropLast(1).toIntArray()
    }

    val answer = curr.joinToString(" ")

    println(answer)
}
