import java.util.*

fun main(args:Array<String>){
    solve()
}

fun solve(){
    val (n,k) = readLine()!!.split(" ").map{it.toInt()}
    val p = readLine()!!.split(" ").map{it.toDouble()}
    var sum = 0.0
    var ans = 0.0
    for(i in 0 until n){
        sum += p[i] * (p[i] + 1) / 2 / p[i]
        if(i >= k) sum -= p[i - k] * (p[i - k] + 1) / 2 / p[i - k]
        if(i + 1 >= k){
            ans = Math.max(ans, sum)
        }
    }
    println("%.20f".format(ans))
}