fun main(args: Array<String>) {
  val (N, K) = readInts()
  val P = readInts()
  val P2 = P.map { it + 1 }

  val sums = Array(N) { 0 }
  sums[0] = P2[0]
  for (i in 1 until N) {
    sums[i] = sums[i - 1] + P2[i]
  }
  var max = sums[K - 1]
  for (i in K until N) {
    max = Math.max(max, sums[i] - sums[i - K])
  }
  println(max / 2.0)
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readInts() = readStrings().map { it.toInt() }
fun readLong() = readString().toLong()
fun readLongs() = readStrings().map { it.toLong() }
