let n, k = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ps = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let s, ms = ref 0, ref 0
let _ = Array.iteri (fun i p -> s := !s + p - if i >= k then ps.(i - k) else 0; ms := max !ms !s) ps; Printf.printf "%.12f\n" @@ float (!ms + k) /. 2.