import Control.Monad
import qualified Data.ByteString.Char8 as C
import Data.List
import Data.Ord

{-
main = flip replicateM_ sub =<< readLn
sub = sol' <$> get <*> get >>= put
get = unfoldr (C.readInt . C.dropWhile (==' ')) <$> C.getLine
put = mapM_ putStrLn
sol' [n,a,b] vs = sol ([n,a,b]:vs:[])
-}

main = C.interact $ put . sol . get

get = fmap (unfoldr (C.readInt . C.dropWhile (==' '))) . C.lines

put = C.pack . unlines

sol ([n,a,b]:vs:[]) = [show ave,show cnt]
  where
  (as,bs) = splitAt a $ sortBy (flip compare) vs
  v = last as
  x = length $ filter (==v) as
  y = min (b-a) (length $ filter (==v) bs)
  cnt = 2^(x+y) - 2^(x-1)
  ave = (fromIntegral $ sum as)/fromIntegral a
