fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val N = sc.nextInt()
    val K = sc.nextInt()
    val P = (1..N).map { sc.nextInt() + 1 }

    var n = P.subList(0, K - 1).sum()
    val r = (0..(N - K)).map { i ->
        n += P[i + K - 1]
        val nn = n
        n -= P[i]
        nn
    }

    val result = r.max()!!.toDouble() / 2
    println(result)
}
