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  
  
  val t = ( p.sliding(k).map(_.sum).max + k ) / 2.0
  
  println(t)
  
}