fun main(args: Array<String>) {
    var (n, k)= readLine()!!.split(' ').map { it.toInt() }
    var pList = readLine()!!.split(' ').map { (it.toDouble() +1)/2}
    var count=0
    var tmp:Double=0.0
    var max:Double= 0.0
    for(p in pList){
        if(count>=k){
            tmp=tmp-pList[count-k]
        }
        tmp=tmp+p
        if(max<tmp) {
            max = tmp
        }
        if(count==pList.size-1){
            break
        }
        count++
    }
    println(max)
}
