open Batteries
let n, k = Scanf.sscanf (read_line()) "%d %d" (fun n k ->n,k)
let dp = Array.init 1010 @@ fun a -> 0.
let a = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ fun a -> a
let ex i =
  if dp.(i) <> 0. then dp.(i) else
  let rec get_sum k =
    if k > float_of_int i then 0. else k +. get_sum (k +. 1.)
  in let x = (get_sum 1.) /. (float_of_int i) in dp.(i) <- x; x

let rec sumf lst =
  match lst with
  | [] -> 0.
  | first :: rest -> first +. sumf rest

let rec loop i =
  if i >= n - k then min_float else
  max (sumf @@ List.init k @@ fun x -> ex a.(i+x)) (loop (i+1))

let _ = Printf.printf "%.12f\n" @@ loop 0
