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 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 a = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ fun a -> ex a

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

let rec loop used now lst i =
  (* 最初をスキップ *)
  if i < k then loop used now (List.tl lst) (i+1) else
  match lst with
  | [] -> now
  | first :: rest -> (
    let new_now = now -. (List.hd used) +. first in
    max now (loop ((List.tl used) @ [first]) new_now rest (i+1))
  )

  
let o = List.init k @@ fun c -> a.(c)
let _ = Printf.printf "%.12f\n" @@ loop o (sumf o) (Array.to_list a) 0
