object Main extends App {
  def getExpect(i: Int): Double = {
    (1 to i).sum.toDouble / i.toDouble
  }
  val nkInput =  scala.io.StdIn.readLine()
  val nkArray = nkInput.split(" ").map(_.toInt).toSeq
  val n = nkArray(0)
  val k = nkArray(1)
  val pInput =  scala.io.StdIn.readLine()
  val pArray = pInput.split(" ").map(_.toInt).toVector

  var maxSum = -1
  var targetIndex = -1
  var sumTotal = 0

  (0 to n - 1).foreach { i =>
    if (i >= k - 1) {
      var tempSum = 0
      (0 to k - 1).foreach { j =>
        tempSum = tempSum + pArray(i - j)
      }
      if(maxSum < tempSum) {
        maxSum = tempSum
        targetIndex = i
      }
    }
  }

  var result = 0d
  (0 to k - 1).foreach { j =>
    result = result + getExpect(pArray(targetIndex - j))
  }

  println(result)

}