Problem2218--ABC151-B - Achieve the Goal

2218: ABC151-B - Achieve the Goal

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

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.

Sample Input Copy

5 10 7
8 10 3 6

Sample Output Copy

8

HINT

If he scores 88 points on the final subject, his average score will be (8+10+3+6+8)/5 = 7(8+10+3+6+8)/5=7 points, which meets the goal.

Source/Category