import Data.Functor mame :: Int -> [Int] -> Int mame s x = if result > 0 then result else -1 where result = s - sum x main = do str1 <- getLine str2 <- getLine let [k, n, f] = map read $ words str1 :: [Int] alist = map read $ words str2 :: [Int] print $ mame (k*n) alist