let split_string ?(pattern=" ") = Str.split @@ Str.regexp pattern
let (n, k) = Scanf.sscanf (read_line ()) "%d %d" @@ fun n k -> (n, k)

let p = read_line () |> split_string |> List.map int_of_string |> Array.of_list
  |> Array.map (fun i -> Array.fold_left (+.) 0. @@ Array.init i (fun v -> float (v + 1) /. float i))

let rec loop i s m =
  if i = n then Printf.printf "%f\n" m
  else 
    let s = s +. p.(i) -. if i < k then 0. else p.(i - k) in
    loop (i + 1) s (max s m)

let () = loop 0 0. 0.