let () = Scanf.scanf "%d %d\n" @@ fun n k ->
  let ps = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun p -> p in
  let acc = Array.make (n + 1) 0 in
  for i = 0 to n - 1 do
    acc.(i + 1) <- ps.(i) + 1 + acc.(i)
  done;
  Printf.printf "%f\n" @@
  Array.fold_left max neg_infinity @@
  Array.init (n - k + 1) @@ fun i ->
    float_of_int (acc.(i + k) - acc.(i)) *. 0.5