fun main(args: Array<String>) {
    val (N, K) = readLine()!!.split(" ").map(String::toInt)
    val PN = readLine()!!.split(" ").map(String::toInt)

    val e = PN.map { (it + 1) / 2.0 }

    var ans = 0.0
    // 先頭区間の計算
    for (i in 0 until K) {
        ans += e[i]
    }

    var tmp = ans
    for (i in K until N) {
        tmp = tmp - e[i - K] + e[i]
        ans = Math.max(ans, tmp)
    }

    println(ans)
}

