import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val k = scanner.nextInt()
    val array = DoubleArray(n+1)

    var max = 0.0
    var preSumE = 0.0

    for (i in 1..n) {
        val value = scanner.nextInt()
        val currentE = if (value == 1) 1.0 else value.toDouble()/2 + 0.5
        array[i] = currentE
        if (i <= k) {
            max += currentE
            preSumE += currentE
        } else {
            val currentSumE = preSumE - array[i-k] + currentE
            if (max < currentSumE) max = currentSumE
            preSumE = currentSumE
        }
    }

    println(max)
}