import scala.io.StdIn._
object Main extends App {
  val Array(n, k) = readLine.split(" ").map(_.toInt)
  val l = readLine.split(" ").map(i => (i.toInt + 1) / 2d)
  var max = l.slice(0, k).sum
  var tmp = max
  for (i <- k until n) {
    tmp = tmp - l(i - k) + l(i)
    max = math.max(max, tmp)
  }
  println(max)
}
