object Main extends App{
  val List(n,k) = readLine.split(" ").map(_.toInt).toList
  val p = readLine.split(" ").map(_.toDouble).toList
  
  def ex: Double => Double = x => (x+1.0)/2.0

  val t = p.sliding(k).map(_.map(ex)).map(_.sum).max  
  println(t)
  
}