There will be several test cases in the input. Each test case will begin with a line with three integers:
n k t where n (1≤
n≤100) is the number of workers you start with,
k (1≤
k≤100) is the number of production facilities you have at the start, and
t (1≤
t≤10,000) is the number of turns. On the next line will be
t-1 integers,
ai (0≤
ai≤Max signed 64-bit integer), separated by single spaces. The i
th integer indicates the strength of the attack (that is, the number of army units your opponent is using in that attack) on turn i. The input will end with a line with three 0s.
Hint
Huge input, please ues c++.