import scala.io.StdIn._

object Main extends App {

  val (n, k) = readNK
  val numList = readLine.split(" ").map(_.toInt)
  val kitaiList = calcKitai(numList)

  var max: Double = 0.0

  for (i <- 0 to kitaiList.length - k) {
    val sum = kitaiList.slice(i, i + k).sum

    if (sum >= max) {
      max = sum
    }
  }

  println(max)

  private def readNK = {
    val nk = readLine.split(" ").map(_.toInt)
    nk(0) -> nk(1)
  }

  private def calcKitai(list: Array[Int]) = list.map { num =>
    (num * (num + 1)).toDouble / (2 * num)
  }
}
