Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 200200 points
Problem Statement
Takahashi is taking exams on NN subjects. The score on each subject will be an integer between 00 and KK (inclusive).
He has already taken exams on N-1N−1 subjects and scored A_iAi points on the ii-th subject.
His goal is to achieve the average score of MM points or above on the NN subjects.
Print the minimum number of points Takahashi needs on the final subject to achieve his goal.
If the goal is unachievable, print -1 instead.
Constraints
-
2 \leq N \leq 1002≤N≤100
-
1 \leq K \leq 1001≤K≤100
-
1 \leq M \leq K1≤M≤K
-
0 \leq A_i \leq K0≤Ai≤K
-
All values in input are integers.
Input
Input is given from Standard Input in the following format:
NNKKMMA_1A1A_2A2......A_{N-1}AN−1
Output
Print the minimum number of points required on the final subject, or -1.