import scala.io.StdIn._

object Main extends App {

  val (n, k) = readNK
  val numList = readLine.split(" ").map(_.toInt)

  var max = -1
  var maxPos = -1
  var sum = -1

  for (i <- 0 to numList.length - k) {

    if (max < 0) {
      sum = numList.slice(i, i + k).sum
    } else {
      sum = sum - numList(i - 1) + numList(i + k - 1)
    }

    if (sum >= max) {
      max = sum
      maxPos = i
    }
  }

  val out = numList.slice(maxPos, maxPos + k).map { num =>
    (num * (num + 1)).toDouble / (2 * num)
  }.sum


  println(out)

  private def readNK = {
    val nk = readLine.split(" ").map(_.toInt)
    nk(0) -> nk(1)
  }
}
