import Data.List
import GHC.Float
import Text.Printf

main = do
  nab <- map (read :: String -> Int) . words <$> getLine
  v <- reverse . sort . map (read :: String -> Double) . words <$> getLine
  let vv = take (nab !! 1) v
      ave = average vv
      lastV = last vv
      inV = length . elemIndices lastV $ vv
      allV = length . elemIndices lastV $ v
  putStrLn $ printf "%.8f" ave
  putStrLn . show $ conb allV inV

average :: [Double] -> Double
average xs = (sum $ map (flip (/) (int2Double $ length xs)) xs)

conb n k = f n k `div` f k k
        where f n k = foldr1 (*) [n-k+1..n]
