import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

fun <A : Comparable<A>> min(a: A, b: A) = if (a < b) a else b
fun <A : Comparable<A>> max(a: A, b: A) = if (a > b) a else b

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val K = sc.next().toInt()
        val A = IntArray(N) { sc.next().toInt() }
        var As = IntArray(N + 1)
        var Ae = IntArray(N + 1)
        for (i in 0 until N) {
            As[max(0, i - A[i])]++
            Ae[min(N, i + A[i] + 1)]++
        }
        repeat(K - 1) {
            val As2 = IntArray(N + 1)
            val Ae2 = IntArray(N + 1)
            var c = 0
            for (i in 0 until N) {
                c = c + As[i] - Ae[i]
                val s = max(0, i - c)
                val e = min(N, i + c + 1)
                As2[s]++
                Ae2[e]++
            }
            As = As2
            Ae = Ae2
            if (As[0] == N && Ae[N] == N) {
                pw.println(Array(N) { N }.joinToString(" "))
                return
            }
            //dprint(As)
            //dprint(Ae)
        }

        val ans = IntArray(N)
        var c = 0
        for (i in 0 until N) {
            c = c + As[i] - Ae[i]
            ans[i] = c
        }
        pw.println(ans.joinToString(" "))
    }
}
