fun main(args: Array<String>) {
    val (N, K) = readLine()!!.split(" ").map(String::toInt)
    val P = readLine()!!.split(" ").map { (it.toDouble() + 1.0) / 2.0 }
    var sum = P.take(K).sum()
    var max = sum
    (0 until P.size - K).forEach { i ->
        sum += P[K+i] - P[i]
        if (max < sum) max = sum
    }
    println(max)
}