import Data.List import Data.Ord main :: IO () main = do n <- read <$> getLine as <- map read . words <$> getLine putStrLn $ unwords $ map show $ solve n as solve :: Int -> [Int] -> [Int] solve n as = [n - kame_count, kame_count] where kame_count = head $ sortOn Down (map (ohter_kame n) as) ohter_kame :: Int -> Int -> Int ohter_kame n t = (t - (n-1)*2) `div` 2