    fun main(args: Array<String>) {
        val nk = readLine()!!.split(" ").map { it.toInt() }
        val plist = readLine()!!.split(" ").map { it.toInt() }

        val queue = mutableListOf<Double>()
        var sum = 0.0
        var max = 0.0
        var index = 0
        plist.forEach {
            val temp = (0..it).sum().toDouble() / it
            queue.add(temp)
            sum += temp
            if (queue.count() >= nk[1]) {
                if (sum > max) {
                    max = sum
                }
                sum -= queue[index - nk[1] + 1]
            }
            index += 1
        }
        print(max.toString())
    }