import Foundation

let array1 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let N = array1[0]
let K = array1[1]
var array =  readLine()!.componentsSeparatedByString(" ").map { Double($0)! }
var sums = [0.0]
for i in 0 ..< N - 1 {
  sums.append(sums[i] + ((1 + array[i]) * 0.5))
}
var answers = [Double]()
for j in 0 ..< N - K {
  answers.append(sums[j + K] - sums[j])
}
answers = answers.sort { $0 > $1 } 
print(answers[0])

//for j in i..<i + K {
//  	answer += 0.5 * array[j] + 0.5
//  }
//answers = answers.sort { $0 > $1 } 
//print()