82 atcoder#ABC151B. [ABC151B] Achieve the Goal

[ABC151B] Achieve the Goal

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 N1N-1 subjects and scored AiA_i 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

  • 2N1002 \leq N \leq 100
  • 1K1001 \leq K \leq 100
  • 1MK1 \leq M \leq K
  • 0AiK0 \leq A_i \leq K
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK MM

A1A_1 A2A_2 ...... AN1A_{N-1}

Output

Print the minimum number of points required on the final subject, or -1.

5 10 7
8 10 3 6
8

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.

4 100 60
100 100 100
0

Scoring 00 points on the final subject still meets the goal.

4 100 60
0 0 0
-1

He can no longer meet the goal.