import scala.io.StdIn._

object Main  {
  def main(args: Array[String]): Unit = {
    val K = readToInts()(1)
    val dice = readToInts()
    println(solve(K, dice))
  }

  def solve(K: Int, dice: Array[Int]): Double = 
    dice.slice(dice.length - K, dice.length).foldLeft(0d)((total, next) => total + ((next + 1) / 2.0))
  

  def readToInts(): Array[Int] = readLine.split(" ").map(_.toInt)
  def readToListInts(): List[Int] = readLine.split(" ").map(_.toInt).toList
}