{-# OPTIONS_GHC -O #-}

import Data.List
import qualified Data.ByteString.Char8 as B

cmb n k = foldl' (\a i->div (a*(n-i+1)) i) 1 [1..k]

main = do
    (n:a:b:_)<-map read.words<$>getLine::IO[Int]
    vs<-sortBy (flip compare).unfoldr (B.readInt.B.dropWhile(==' '))<$>B.getLine::IO[Int]
    --
    print $ hei a vs
    print $ solve a b vs
--
hei a vs = flip (/) (fromIntegral a) $ fromIntegral $ sum $ take a vs

solve a b vs@(va:vd)
    | la >= a = sum $ map (cmb la) [a..lb]
    | otherwise = cmb ld lc
    where
        la = length $ takeWhile(==va) vs
        lb = min la b
        lc = length $ takeWhile(==va) $ take a vs
        ld = length $ filter(==(vs !! (a-1))) vs
         