let NK: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let N: Int = NK[0]
let K: Int = NK[1]
var seqNow: [Int] = readLine()!.split(separator: " ").map { Int($0)! }

for _ in 0..<K {
    var seqNext = Array(repeating: 0, count: N+1)

    for (i, a) in seqNow.enumerated() {
        let left: Int = max(0, i-a)
        let right: Int = min(N, i+1+a)
        
        seqNext[left] += 1
        seqNext[right] += -1
    }
    for i in 1..<N {
        seqNext[i] = seqNext[i] + seqNext[i-1]
    }
    if seqNow[0..<N] == seqNext[0..<N] { break }
    seqNow[0..<N] = seqNext[0..<N]
}
var res: String = ""
for s in seqNow[0..<N-1]{
    res += "\(s) "
}
print(res + String(seqNow[N-1]))