import java.lang.Math

fun main(args: Array<String>) {
    val (N, K) = readInputLine().split(" ").map { it.toInt() }
    val ps = readInputLine().split(" ").map { it.toInt() }

    val E = DoubleArray(1001) { it * (it + 1) / 2.0 / it.toDouble()}

    var ans = 0.0

    for (i in 0 until K) {
        ans += E[ps[i]]
    }

    var tmp = ans

    for (i in K until N) {
        tmp -= E[ps[i - K]]
        tmp += E[ps[i]]
        ans = Math.max(ans, tmp)
    }

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}
