The Final Exam
Your first N−1 scores are given; scores are integers in [0, 100]. Print the minimum final-exam score so the average of all N scores is at least T, or IMPOSSIBLE if even 100 is not enough.
Input: the first line has N and T; the second line has the N−1 existing scores.
Output: the minimum required score (possibly 0), or IMPOSSIBLE.
Constraints:
- 2 ≤ N ≤ 104
- 0 ≤ T ≤ 100
Sample Tests
Input 1
3 90 85 88
Output 1
97
Input 2
2 100 99
Output 2
IMPOSSIBLE
Discussion (opens after you solve — no spoilers before)
No comments yet.