import java.util.Scanner;

fun main (args : Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val N = input.nextInt()
    val K = input.nextInt()
    val p = IntArray(N)
    
    for (i in p.indices) {
      p[i] = input.nextInt()
    }
    
    var maxExpValue = 0.0
    for (i in 0..K-1) {
      maxExpValue += (1 + p[i]) / 2.0
    }
    
    var currentExpValue = maxExpValue
    for (i in K..p.lastIndex) {
      currentExpValue -= (1 + p[i - K]) / 2.0
      currentExpValue += (1 + p[i]) / 2.0
      maxExpValue = Math.max(maxExpValue, currentExpValue)
    }
    
    println(maxExpValue)
  }
}