import java.io.BufferedReader
import java.io.InputStreamReader
import kotlin.math.max
import kotlin.math.min

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val (n, k) = jin.readLine().split(" ").map { it.toInt() }
    var bulbs = jin.readLine().split(" ").map { it.toInt() }.toIntArray()
    for (j in 1..k) {
        var newBulbs = IntArray(n + 1)
        for (b in 0 until n) {
            newBulbs[max(0, b - bulbs[b])]++
            newBulbs[min(n, b + bulbs[b] + 1)]--
        }
        var changed = false
        for (b in 1 until n) {
            newBulbs[b] += newBulbs[b - 1]
            if (newBulbs[b] != bulbs[b]) {
                changed = true
            }
        }
        if (!changed) {
            break
        }
        bulbs = newBulbs
    }
    println(bulbs.toList().subList(0, n).joinToString(" "))
}