#include #include #include #include #include #include #include #include #include #include #include typedef long long ll; typedef unsigned int uint; using namespace std; int main() { int k, n, f; cin >> k >> n >> f; int a[f]; int sum = k * n; for (int i = 0; i < f; i++) { cin >> a[i]; } int out = 0; for (int i = 0; i < f; i++) { if (out + a[i] > sum){ cout << -1 << endl; } out += a[i]; } cout << sum - out << endl; }