object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, K = sc.nextInt()
  val scanned = Array.fill(N)(sc.nextInt()).scanLeft(0.0)((acc, i) => acc + (i + 1) / 2.0)
  val max = (K + 1).to(N).foldLeft(0.0)((acc, i) => acc.max(scanned(i) - scanned(i - K)))
  println(max)
}
