题目描述
Problem Description
Nanami has participated in the Team Programming Ladder Competition. The competition has a unique format, which is excerpted below.
The competition consists of questions divided into 3 tiers:
- The basic tier includes 8 questions, with 2 questions each worth 5, 10, 15, and 20 points respectively, totaling 100 points.
- The advanced tier includes 4 questions, each worth 25 points, totaling 100 points.
- The top tier includes 3 questions, each worth 30 points, totaling 90 points.
The individual total score of a participant is composed of the scores of each question. However, only when the total score of the basic tier questions exceeds 80 points, the scores of the advanced tier questions are considered valid for the individual. Similarly, the scores of the top tier questions are considered valid only when the total score of the advanced tier questions exceeds 40 points.
Note that "exceeds" here means greater than or equal to.
Given the scores of a participant for all 15 questions in the order of basic, advanced, and top tiers, please calculate the valid score of the participant.
Input Format
The input consists of three lines.
- The first line contains 8 integers, representing the scores of the participant's basic tier questions.
- The second line contains 4 integers, representing the scores of the participant's advanced tier questions.
- The third line contains 3 integers, representing the scores of the participant's top tier questions.
Output Format
Output a single integer on one line, representing the valid score of the participant.
Sample Input and Output
Sample Input #1
5 5 10 10 15 15 20 20
25 25 16 25
0 1 0
Sample Output #1
192
Sample Input #2
0 0 0 0 0 0 1 1
25 25 25 25
30 30 30
Sample Output #2
2
Notes
For 100% of the test data, the input data are integers and conform to the actual scenario of the problem.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分