let [|N;K|] =
    stdin.ReadLine().Split()
    |> Array.map int
let p =
    stdin.ReadLine().Split()
    |> Array.map int

let p' =
    p
    |> Array.map (fun x -> (float(x)+1.0)/2.0)
    |> Array.scan (+) 0.0

[|0..(N-K)|]
|> Array.map (fun x -> p'.[x+K]-p'.[x])
|> Array.max
|> stdout.WriteLine