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 answer = 0.0
var answers = [Double]()
for i in 0...N - K {
  for j in i..<i + K {
  	answer += 0.5 * array[j] + 0.5
  }
  answers.append(answer)
  answer = 0.0
}
answers = answers.sort { $0 > $1 } 
print(answers[0])