peace, bag, family = gets.chomp.split(" ").map &:to_i old = gets.chomp.split(" ").map &:to_i total_beans = peace * bag total_years = old.inject if total_beans >= total_years puts "#{total_beans - total_years}" else puts "-1" end