Question: rust Problem 1 . Minimum Grade Given the minimum GPA criteria for this semester and the grades of all subjects taken except one, output the
rust
Problem Minimum Grade
Given the minimum GPA criteria for this semester and the grades of all subjects taken except one, output the minimum letter grade required for the remaining subject to meet the minimum GPA criteria. The grade conversion table according to the scores is as follows: The GPA for this semester is calculated as the sum of credits x grade of each subject over all subjects: total credits taken this semester rounded down to the third decimal place. If the GPA for this semester exceeds the minimum GPA criteria, it is considered to have met the criteria. However, be careful of floatingpoint errors when using floatingpoint types.
letter gradeAABBCCDDF
Input
The first line contains the number of subjects taken this semester N and the minimum GPA criteria X separated by a space N ; X ; X is a real number given up to two decimal places
From the second line to the N th line, the credits cii and the letter grade gi of each subject are given separated by a space ci ; gi is one of A A B B C C D D F
The next line gives the credits L of the remaining one subject L
Output
Output the minimum letter grade required for the remaining subject to meet the minimum GPA criteria.
If it is impossible to meet the criteria regardless of the grade received, print "impossible".
Example
Input
A
B
C
D
Output
A
If the grade for the remaining subject is A the GPA for this semester would be times times times
times times : rounded down to the third decimal place,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
