fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val n = sc.nextInt()
    val k = sc.nextInt()
    val p = sc.asSequence().take(n).map(String::toInt).toList()

    var sum = p.take(k).sum()
    var max = sum
    var idx = k - 1

    (k until n).forEach {
        sum += p[it]
        sum -= p[it - k]
        //println(sum)
        if (sum > max) {
            max = sum
            idx = it
        }
        //println(it)
    }

    print(((idx - k + 1)..idx).map { (p[it] + 1) / 2.0 }.sum())
}
