시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 81 60 49 75.385%

문제

Little hobbitses go to hobbit school in the Shire. They just finished a course, which involved tea-making, meal-eating, nap-taking, and gardening. Based on the following grading scale, assign each hobbit a letter grade based on their final numerical course grade.

  • A+: 97-100
  • A: 90-96
  • B+: 87-89
  • B: 80-86
  • C+: 77-79
  • C: 70-76
  • D+: 67-69
  • D: 60-66
  • F: 0-59

입력

The input will begin with a single line containing just a whole number, n, of the number of hobbits in the class, followed by n lines in the form a b, where a is the hobbit’s name (only alphabetical characters) and b is the hobbit’s grade, given as a whole number.

출력

For each test case, print out a list of every hobbits name and letter grade, each on its own line. There should be no additional white space following test cases.

예제 입력

5
Bilbo 13
Sam 90
Pippin 78
Frodo 97
Merry 70

예제 출력

Bilbo F
Sam A
Pippin C+
Frodo A+
Merry C

힌트