object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, K = sc.nextInt
  var a: Seq[Double] = Seq()

  for (i <- 0 until N) {
    val ai: Double = sc.nextInt
    val p: Double = (ai + 1) / 2
    a = a :+ p
  }
  var shaku = a.slice(0, K).foldLeft(0.0)(_ + _)
  var ans:Double = shaku
  for (i <- 0 until N-K) {
    shaku = shaku + a(i + K) - a(i)
    ans = math.max(shaku, ans)
  }
  println(ans)
}

