import scala.io.StdIn._

object Main  {
  def main(args: Array[String]): Unit = {
    val K = readToInts()(1)
    val dice = readToVectorInts()
    println(solve(K, dice))
  }

  def solve(K: Int, dice: Vector[Int]): Double = {
    val diceAvg = dice.map(Dice.avg)

    val initial = Iterator.iterate(0)(n => n + 1)
      .takeWhile(n => n < K)
      .map(n => diceAvg(n))
      .toList
      .foldLeft(0d)((total, next) => total + next)

    Iterator.iterate(Dice(0, initial))(d => d.getNewDice(diceAvg, K))
      .takeWhile(d => d.index <= dice.length - K)
      .maxBy(dice => dice.total)
      .total
  }

  def readToInts(): Array[Int] = readLine.split(" ").map(_.toInt)
  def readToListInts(): List[Int] = readLine.split(" ").map(_.toInt).toList
  def readToVectorInts(): Vector[Int] = readLine.split(" ").map(_.toInt).toVector

}

case class Dice(index: Int, total: Double) {

  def getNewDice(vec: Vector[Double], K: Int): Dice = {
    if (index + K >= vec.length) {
      Dice(index + 1, 0.0)
    } else {
      Dice(index + 1, total + vec(index + K) - vec(index))
    }
  }

  override def toString: String = s"$index - $total"
}

object Dice {
  def avg(v: Int): Double = (v + 1.0) / 2.0
}