#!/usr/bin/perl use warnings; use strict; my ($k, $n, $f) = split / /, <>; my $year = <>; chomp $year; my @array = split / /, $year; my $total = 0; for(my $i = 0; $i < $f; $i++) { $total += $array[$i]; } my $ans = $k * $n - $total; if($ans < 0) { print "-1\n"; } else { print "$ans\n"; } exit;