P8823 [Chuanzhi Cup #3 Preliminary] Final Exam Scores
Description
The evaluation system for the Java Programming course at Chuanzhi Academy is as follows.
First, every student has a written exam score, which must be an integer in $[0,100]$.
If the written exam score is at least $90$, then their GPA (weighted average grade) is the full score $4.0$.
If the written exam score is between $60$ and $89$, then for each point less than $90$, their GPA decreases by $0.1$ from $4.0$.
If the written exam score is less than $60$, then the kind teacher will give them some help. Specifically, if their score is $x$, the teacher will adjust the score to $\sqrt{x}\times 10$ (rounded down), and then calculate their GPA.
If after the adjustment the student’s score is still less than $60$, then they fail the course, and the GPA is $0.0$.
Now you are given a person’s final written exam score. Please output their final GPA.
Input Format
One line with one integer $x$, representing the person’s final exam score.
Output Format
A floating-point number with exactly one digit after the decimal point, representing the student’s GPA.
Note that if there is a trailing $.0$, you must keep it.
Explanation/Hint
For $20\%$ of the testdata, $90 \leq x \leq 100$.
For an additional $30\%$ of the testdata, $60 \leq x \leq 100$.
For $100\%$ of the testdata, $0 \leq x \leq 100$.
Translated by ChatGPT 5