fun main(arg: Array<String>) {
    val (N, K) = listOfInt()
    val P = listOfInt()
    val e = P.map { (it + 1).toDouble() / 2.0 }
    val s = DoubleArray(N + 1)
    for (n in 0 until N) s[n + 1] = s[n] + e[n]
    var ans = 0.0
    for (n in 0 .. N - K) {
        ans = Math.max(ans, s[n + K] - s[n])
    }
    println(ans)
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfDouble() = listOfString().map(String::toDouble)
