Scanf.scanf "%d %d %d" (fun n a b ->
    let module M = Map.Make (struct type t = int let compare a b = compare b a end) in
    let rec loop i acc =
        if i = n then acc else
            let acc = Scanf.scanf " %d" (fun v ->
                M.add v (1 + try M.find v acc with _ -> 0) acc
            )
            in
            loop (i + 1) acc
    in
    let map = loop 0 M.empty in
    let bin a b =
        let rec loop x y acc =
            if y > b then acc else
                loop (x - 1) (y + 1) (acc * x / y)
        in
        loop a 1 1
    in
    let rec loop sum count = function
        | [] -> failwith "??"
        | (v, c) :: tl ->
                if count + c < a then loop (sum + v * c) (count + c) tl else (
                    if sum > 0 then (
                        let sum = sum + v * (a - count) in
                        let avg = float sum /. float a in
                        let comb = bin c (a - count) in
                        avg, comb
                    ) else (
                        let avg = float v in
                        let mx = min b c in
                        let rec loop i acc =
                            if i > mx then acc else
                                let acc = acc + bin c i in
                                loop (i + 1) acc
                        in
                        let comb = loop a 0 in
                        avg, comb
                    )
                )
    in
    let avg, comb = loop 0 0 (M.bindings map) in
    Printf.printf "%.8f\n%d\n" avg comb
)