import java.math.BigDecimal
import java.math.RoundingMode
import java.util.*

fun main(args: Array<String>) {
    val (N,K) = readLine()!!.split(" ").map(String::toInt)
    val P = readLine()!!.split(" ").map(String::toDouble)

    var plus = 0.0
    var queue = ArrayDeque<Double>()

    for(i in 0 until K-1){
        var current = 0.5 * (P[i]+1)
        plus += current
        queue.offer(current)
    }

    var max = plus

    for(i in K-1 until N){
        var current = 0.5 * (P[i]+1)

        plus += current
        max = Math.max(plus,max)
        queue.offer(current)
        plus -= queue.poll()
    }

    var big = BigDecimal(max).divide(BigDecimal.ONE,13,RoundingMode.HALF_UP)
    println(big)
}