The Coyote is currently taking courses and wants to be able to quickly calculate his averages. Since the Coyote's main goal is to get a overall average, he's decided to drop a course.
He wants to know how his new average will change depending on which course he decides to drop. He also wants to know which course he should drop to get closer to his goal.
Your task is to write a program that reads his courses and associated averages, then calculates his average before he drops his selected course, his average after he drops the course, and finally which course he should drop to get as high an average as he can.
Input Specification
The first line of input will consist of the single integer .
The next lines will contain course information. The line will contain the name of the course followed by a single space followed by the Coyote's mark in the course in % format (i.e. 90%
).
The next line will contain the name of the course the Coyote wants to drop.
Output Specification
The first line of output should contain the Coyote's average prior to dropping a course, rounded to two decimal places and in % format.
The next line of output should contain his average after dropping a course, in % format and rounded to two decimal places.
The next line of output should contain the name of the course he should drop to have the largest positive increase in his mark. If there are two courses with the same lowest mark, output the first one that is inputted as the recommended course to drop.
The next line of output should contain his average if he drops the optimal course.
If his average after dropping the optimal course is over , output You have reached your goal.
Otherwise, output You are N% away from your goal.
, where represents the difference between your goal and your average after you drop the optimal course. If is a decimal, always round DOWN, i.e. .
Sample Input
6
Math 95%
Physics 85%
English 80%
Chemistry 90%
TechDesign 90%
ComputerSciences 95%
Physics
Sample Output
89.17%
90.00%
English
91.00%
You are 4% away from your goal.
Comments