Points to Grade


Submit solution

Points: 100
Time limit: 5.0s
Memory limit: 256M

Author:
Problem type

Problem Statement

Samar is a college student and she was checking her grades for the current semester. She wants to know how hard should she study based on how close is she to getting the next highest grade.
Help her by making a program that will accept her current points in the class. The program then should tell her how close is she to the next nearest grade (A / B / C / D).
For example, if her grade is 89, then she needs 1 point to get A.


Constraints

X is the grade points, a decimal from 0 to 89.
The grade ranges are:

  • A: 100 to 90 inclusive
  • B: 80 to 89 inclusive
  • C: 70 to 79 inclusive
  • D: 60 to 69 inclusive

Input

Input is in the following format (float):

X

Output

Print next closest grade and number of points needed (float). For example:

A
2.0

Samples

Sample 1

Input Output
45 D
15.0

Sample 2

Input Output
77 B
3.0

Sample 3

Input Output
85 A
5.0

Comments

There are no comments at the moment.