object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n, k = sc.nextInt
    val p = new Array[Int](n)
    for (i <- 0 until n) {
      p(i) = sc.nextInt
    }

    var index = 0
    var max = 0
    for (i <- 0 to n - k) {
      var sum = 0
      for (j <- i to i + k - 1) {
        sum += p(j)
      }
      if (sum >= max) {
        max = sum
        index = i
      }
    }

    var ans = 0d
    for (i <- index to index + k - 1) {
      var sum = 0
      for (j <- 1 to p(i)) {
        sum += j
      }
      ans += sum.toDouble / p(i)
    }


    printf("%.9f\n", ans)
  }
}
