#P11154. Arcaea Score Rating Calculation

    ID: 13217 Type: Default 1000ms 256MiB

Arcaea Score Rating Calculation

Arcaea Score Rating Calculation

Arcaea is a global hit music game known for its innovative three-dimensional gameplay interface. In a playthrough, the score is based on judgment results for several objects, each judged as Great Pure (大 Pure), Just Pure (小 Pure), Far, or Lost. For a chart with \(n\) objects, the score is calculated as follows:

  • The basic score is \(10^7\), evenly distributed among the \(n\) objects. Thus, each object has a basic score of \(\frac{10^7}{n}\).
  • The additional score is \(n\) points, with exactly \(1\) extra point available per object if it is judged as Great Pure.
  • If an object is judged as Great Pure, the player receives its full basic score and the additional point.
  • If an object is judged as Just Pure, the player receives its full basic score but no additional point.
  • If an object is judged as Far, the player receives half of the basic score for that object.
  • If an object is judged as Lost, the player receives no score.

The total play score is the floor of the sum of the scores from all objects. Based on the final play score \(S\), the rating is awarded as follows:

  • If \(S \ge 9.9\times10^6\): Rating is EX+
  • If \(9.8\times10^6 \le S < 9.9\times10^6\): Rating is EX
  • If \(9.5\times10^6 \le S < 9.8\times10^6\): Rating is AA
  • If \(9.2\times10^6 \le S < 9.5\times10^6\): Rating is A
  • If \(8.9\times10^6 \le S < 9.2\times10^6\): Rating is B
  • If \(8.6\times10^6 \le S < 8.9\times10^6\): Rating is C
  • If \(S < 8.6\times10^6\): Rating is D

You are given the counts of the four judgments in the following order: Great Pure, Just Pure, Far, and Lost. Calculate the rating for the play.

inputFormat

The input consists of a single line containing four non-negative integers separated by spaces. They represent the number of Great Pure, Just Pure, Far, and Lost judgments respectively. It is guaranteed that the total number of objects \(n\) (i.e. the sum of the four numbers) is positive.

outputFormat

Output a single line containing the rating, which is one of EX+, EX, AA, A, B, C, or D.

sample

100 0 0 0
EX+