Report Card Time
Time limit1sMemory limit256 MB
Convert each hobbit's numeric score to a letter grade using the given scale and print the results in input order.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Hobbit children in the Shire go to hobbit school. A course just ended, and it covered tea making, meal eating, nap taking, and gardening. Turn each hobbit's final numerical grade into a letter grade with the scale below.
- A+: 97 to 100
- A: 90 to 96
- B+: 87 to 89
- B: 80 to 86
- C+: 77 to 79
- C: 70 to 76
- D+: 67 to 69
- D: 60 to 66
- F: 0 to 59
Input
The first line contains one integer , the number of hobbits in the class ().
Each of the next lines contains a name and a grade separated by one space. A name consists of alphabetical characters only and is shorter than 10 characters. A grade is an integer with .
Output
Print one line per hobbit, in the order the hobbits are given, containing the name and the letter grade separated by one space. Print no other whitespace.