import std.stdio; import std.algorithm; import std.conv; import std.range; void main() { auto input = readln.splitter.map!(to!int).array; immutable numBeans = input[0] * input[1]; immutable totalAge = readln.splitter.map!(to!int).sum; writeln(numBeans >= totalAge ? numBeans - totalAge : -1); }