import scala.math._

object Methods {
  //K回この操作をする: 照らしている個数のシーケンスを返す
  def UpdateBrightness(N: Int, BrightSeq: Seq[Int]): Seq[Int] = {
    val illuminateNum: Array[Int] = Seq.fill(N)(0).toArray[Int]

    //Mapとかでもできそう。時間制限にひっかかるなら改良
    var i = 0
    while (i < N) {
      //照らす範囲下部分
      val illuminateBottom: Int = {
        if (i - BrightSeq(i) < 0) 0
        else i - BrightSeq(i)
      }
      val illuminateTop: Int = {
        if(i + BrightSeq(i) > BrightSeq.length) BrightSeq.length
        else i + BrightSeq(i)
      }

      illuminateNum.zipWithIndex.foreach{
        case (v, i) => if(illuminateBottom <= i && i <= illuminateTop) illuminateNum(i) = v + 1
      }
      i += 1
    }//while締め
    illuminateNum.toSeq
  }

  def loop(k: Int, K: Int, N: Int, Brightness: Seq[Int]): Seq[Int] = {
    val CurrentBrightness = UpdateBrightness(N, Brightness)

    if(k < K  && k < 5) loop(k+1, K, N, CurrentBrightness)
    else CurrentBrightness
  }
}

object Main extends App {
    val tempList: Seq[Seq[String]] = {
      for (line <- io.Source.stdin.getLines()) yield {
        line.split(' ').toSeq
      }
    }.toSeq
    val N: Int = tempList(0)(0).toInt
    val K: Int = tempList(0)(1).toInt
    val initBrightness: Seq[Int] = tempList(1).map(_.toInt)

    //K回更新
    val kUpBrightness: Seq[Int] = Methods.loop(1, K, N, initBrightness)

    //val kUpBrightness: Seq[Int] = UpdateBrightness(N, initBrightness)
    println(kUpBrightness.mkString(" "))
}