fun main() {
    val builder = StringBuilder()

    val (n, k) = readInputLine().split(" ").map { it.toInt() }
    var aArr = readInputLine().split(" ").map { it.toInt() }.toIntArray()

    for (i in 1..k.coerceAtMost(50)) {
        val bArr = IntArray(n)

        for (j in 0 until n) {
            val l = (j - aArr[j]).coerceAtLeast(0)
            val r = (j + aArr[j]).coerceAtMost(n - 1)
            bArr[l]++
            if (r + 1 < n) {
                bArr[r + 1]--
            }
        }

        for (j in 1 until n) {
            bArr[j] += bArr[j - 1]
        }

        aArr = bArr
    }


    builder.appendln(aArr.joinToString(" "))

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
