let [|n;k|] = stdin.ReadLine().Split() |> Array.map int
let p = stdin.ReadLine().Split() |> Array.map float
let sum = p |> Array.map (fun x -> (x+1.0)/2.0)

let va l = sum.[l..(l+k-1)] |> Array.sum
let rec f i v max = if i=n-k+1 then max
                    else
                        let value = v-sum.[i-1]+sum.[i+k-1]
                        f (i+1) value (Array.max [|max;value|])
f 1 (va 0) (va 0) |> stdout.WriteLine