import Foundation

let line = readLine()!.components(separatedBy: " ").map { Int($0)! }
let N = line[0]
let K = line[1]
var A = readLine()!.components(separatedBy: " ").map { Int($0)! }

var B = Array.init(repeating: 0, count: N)

for _ in 0..<K {
    for i in 0..<N {
        let s = 0 < i - A[i] ? i - A[i] : 0
        let e = i + A[i] < N ? i + A[i] : N - 1
        for t in s...e {
            B[t] += 1
        }
    }
    A = B
    B = Array.init(repeating: 0, count: N)
}

A.forEach { print($0, terminator: " ") }