fun main(){
    val (n, k) = readLine()!!.split(" ").map{it.toInt()}
    val p = readLine()!!.split(" ").map{it.toDouble()}
    val expectedValue = p.map{(it + 1) /2}

    val expectedValueTotal = mutableListOf<Double>()
    var tmp = 0.0
    expectedValueTotal.add(0.0)
    expectedValue.forEach{
        tmp += it
        expectedValueTotal.add(tmp)
    }
    //println(expectedValueTotal)
    var max = 0.0
    for(i in 1 .. expectedValueTotal.size - k){
        (expectedValueTotal[i + k - 1] - expectedValueTotal[i-1]).let{
            if(it > max) max = it
        }
    }
    println(max)
}