fun main(args: Array<String>) {
    var (N,K) = readLine()!!.split(" ").map { it.toInt() }
    var p = readLine()!!.split(" ").map { it.toLong() }
    var s = 0.toLong()
    for(i in 0 until K)s += p[i]
    var result = s
    for(i in K until N){
        s += ( p[i] - p[i-K])
        if (s>result){
            result = s
        }
    }
    println((result+K).toFloat()/2)
}