Hiring process8 levels
  1. 1 IQ Test
  2. 2 Additional Online Test (If Required)
  3. 3 Office Interview with Hiring Manager
  4. 4 Unpaid Test Task (Motivation Check)
  5. 5 Paid Test Task and Follow-Up Interview
  6. 6 Iterative Paid Test Tasks
  7. 7 Office Verification
  8. 8 Final Interview with the Founder

Problems > The Final Exam

The Final Exam

Difficulty: 1000 2000 ms 128 MB

math

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

Read the Editorial Statistics

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.
Ctrl+Enter submit · Ctrl+Space autocomplete · F11 fullscreen