let NK: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let As: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
var seqNow: [Int] = Array(repeating: 0, count: NK[0]+1)
//var seqNext: [Int] = Array(repeating: 0, count: NK[0]+1)
seqNow[0..<NK[0]] = As[0..<NK[0]]

for _ in 1...NK[1] {
    var seqNext = Array(repeating: 0, count: NK[0]+1)
    for (i, a) in seqNow.enumerated() {
        seqNext[max(0, i-a)] += 1
        seqNext[min(NK[0], i+1+a)] += -1
    }
    seqNow[0] = seqNext[0]
    for i in 1..<NK[0] {
        seqNow[i] = seqNow[i-1] + seqNext[i]
    }
}
var res: String = ""
for s in seqNow[0..<NK[0]-1]{
    res += "\(s) "
}
print(res + String(seqNow[NK[0]-1]))