import scala.io.StdIn._

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

  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 {
  private def avg(v: Int): Double = (v + 1.0) / 2.0

  private def createInitial(K: Int, vec: Vector[Double]): Dice = {
    val total = Iterator.iterate(0)(n => n + 1)
      .takeWhile(n => n < K)
      .map(n => vec(n))
      .sum

    new Dice(0, total)
  }

  def getTotal(K: Int, vec: Vector[Int]): Double = {
    val average = vec.map(Dice.avg)
    Iterator.iterate(createInitial(K, average))(d => d.getNewDice(average, K))
      .takeWhile(d => d.index <= vec.length - K)
      .maxBy(dice => dice.total)
      .total
  }
}