main = getLine >>= solve . map read . words solve :: [Int] -> IO () solve [k, n, _] = getLine >>= print . judge . foldl (\acc x -> acc - read x) (k * n) . words where judge x | x < 0 = (-1) | otherwise = x