import java.util.*
 
fun main(args: Array<String>) {
    val scn = Scanner(System.`in`)
    val N = scn.nextInt()
    val K = scn.nextInt()
 
    var p = 0
    var list = mutableListOf<Int>()
    list.add(0)
    var maxP = 0
    for(i in 1..N){
        p = scn.nextInt()
        list.add(p + list[i-1])
 
        if(i>=K){
            var tmp = list[i] - list[i-K]
            if(maxP < tmp) maxP = tmp
        }
    }
 
    println((maxP+K).toFloat()/2f)
}