class Calc0143 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @k, @n, @f = args.shift.map(&:to_i) @as = args.shift.map(&:to_i) end def calc @k * @n - @as.inject(:+) end def run r = calc r < 0 ? -1 : r end end puts Calc0143.new(STDIN.readlines).run if __FILE__ == $0