import scala.io.StdIn._

object Main extends App {
  val nk = readLine.split(" ").map(_.toInt)
  val n = nk(0)
  val k = nk(1)

  val numList = readLine.split(" ").map(_.toInt)
  val kitaiList = numList.map(n => n + 1) // 期待値(n+1/2)の2倍

  var max = kitaiList.slice(0, k).sum
  var sum = max
  for (i <- k until kitaiList.length) {
    sum = sum - kitaiList(i - k) + kitaiList(i)
    if (sum > max) {
      max = sum
    }
  }

  println(max.toDouble / 2)
}
