Editorial for Arcadia Computing Contest 1 P1 - Test Anxiety


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: kevlu8

Let the student's current average be denoted as S_{avg}, and the current number of assignments they have completed to be N. As we know that each assignment is weighted equally and is scored out of 100, we can deduce that the total points they have earned through all assignments so far is S_{avg}\cdot N.

The student has one more assignment to complete, thus making the total points possible including the next assignment to be 100(N+1).

In order to attain at least an 80\% average, the student must obtain a total score of at least 80(N+1). If this has already been achieved, simply print 0. Otherwise, print the missing score, which is 80(N+1)-(S_{avg}\cdot N). If this missing score is greater than 100, print that it is impossible.

Final complexity: O(1)


Comments

There are no comments at the moment.