import java.util.Scanner

import scala.collection.mutable
import scala.util.control.Breaks

object Main {

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    //    val n = (Math.pow(10, 5) * 2).toInt
    //    val k = (Math.pow(10, 5) * 2).toInt
    //    var a = mutable.ArrayBuffer.fill(n)(0)
    val n = sc.nextInt()
    val k = sc.nextInt()
    var a = mutable.ArrayBuffer.fill(n)(sc.nextInt())

    val b = new Breaks
    b.breakable {
      (1 to k).foreach { _ =>
        val store = mutable.ArrayBuffer.fill(n)(0)
        (0 until n).foreach { i =>
          val d = a(i)
          (i - d to i + d).foreach { j =>
            if (0 <= j && j <= n - 1) store(j) += 1
          }
        }
        a = store
        if (a.min == n) b.break()
      }
    }
    println(a.mkString(" "))

  }

}
