P3954 [NOIP 2017 Junior] Score
Background
NOIP 2017 Junior T1.
Description
Niuniu recently studied an introductory C++ course. The total score for this course is calculated as:
$$
\text{总成绩}=\text{作业成绩}\times 20\%+\text{小测成绩}×30\%+\text{期末考试成绩} \times 50\%
$$
Niuniu wants to know the final score they can get in this course.
Input Format
Three non-negative integers $A, B, C$, representing Niuniu’s homework score, quiz score, and final exam score, respectively. Adjacent numbers are separated by a single space. Each of the three scores is out of $100$ points.
Output Format
A single integer: Niuniu’s total score for the course, also out of $100$ points.
Explanation/Hint
**Sample 1 Explanation**
Niuniu’s homework score is $100$ points, quiz score is $100$ points, and final exam score is $80$ points. The total score is $100 \times 20\%+100 \times 30\%+80 \times 50\%=20+30+40=90$.
**Sample 2 Explanation**
Niuniu’s homework score is $60$ points, quiz score is $90$ points, and final exam score is $80$ points. The total score is $60 \times 20\%+90 \times 30\%+80 \times 50\%=12+27+40=79$.
**Constraints**
- For $30\%$ of the testdata, $A=B=0$.
- For another $30\%$ of the testdata, $A=B=100$.
- For $100\%$ of the testdata, $0≤A,B,C≤100$ and $A,B,C$ are all multiples of $10$.
Translated by ChatGPT 5