private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main(args: Array<String>) {
    val (n, k) = readInts()
    val p = readInts()
    var sum = 0
    for (i in 0.until(k)) {
        sum += p[i]
    }
    var res = sum
    for (i in k.until(n)) {
        sum -= p[i - k]
        sum += p[i]
        res = if (res < sum) sum else res
    }
    println((res + k) / 2.0)
}