-->
当前位置:首页 > 题库

PROGRAMMING:Play billiards

Luz5年前 (2021-05-10)题库419
Yang is addicted to a billiards game called Norsk, and with the deepening of practice, he can always open the plug-in mode at some magical moment. At this time, Xiao Li will point to where to play until there is no ball to play. Now Yang wants you to help him calculate the maximum score he can get when he starts plug-in mode. Note: the number of balls on the table may be different from that of traditional snooker.
The basic rules of the competition are as follows:
1. The ball is divided into eight colors: red (1), yellow (2), green (3), brown (4), blue (5), pink (6), black (7) and white (main ball, control the white ball to play the rest of the ball);
2. When there is a red ball on the table, you must hit a red ball first, and then you can hit only one colored ball (excluding the red ball). At this time, the bagged colored ball will be put back on the table and the process will be repeated all the time;
3. When there is no red ball after playing rule 2, hit it into the bag from low to high according to the score of the ball.
###Input format:
Input only one line, a total of 7 integers separated by spaces, which are the number of red, yellow, green, brown, blue, pink and black balls on the current table.
###Output format:
Output 1 integer, which means the highest score Yang can get.
###Input example:
```in
2 0 1 0 3 0 2
```
###Output example:
```out
forty-eight
```
*There are 2 red balls, 1 green ball, 3 blue balls and 2 black balls on the table. The highest score is red black red black green blue blue black black black. You can get 48 points in total*







answer:If there is no answer, please comment