#A0000. 卖水果
卖水果
Title Description
33DAI and Kitten are currently playing a game. There are four common fruits in the game: "lime", "apple", "banana", and "sato".
Today Kitten picked (ensuring that is a multiple of ) of each fruit, totaling , and handed them over to 33DAI for sale. 33DAI has three sales strategies:
- All four types of fruits can be used to make jam, and of a certain fruit can be used to make a corresponding jar of jam. The price of all four types of jam is yuan.
- You can use two fruits of each type, for a total of , to make a fruit salad. The price of the fruit salad is yuan.
- Of course, it can also be directly roasted and sold. The unit prices for the four types of fruits roasted and sold are , ,, and , respectively.
In fact, fresh fruits can also be sold, but the price of fresh fruits in the game is inevitably lower than that of ripe ones, so 33DAI will never adopt this method.
Now 33DAI wants to choose one of the sales strategies to sell all the goods. Please help him calculate which sales strategy can maximize the profit!
Attention: Only one sales strategy is allowed and cannot be mixed. For example, lime cannot be made into jam, while apples are roasted and sold
Input format
The first row consists of three integers separated by spaces. The next line consists of four integers a_2, a_4 $separated by spaces, with the meanings as described in the question.
Output format
One integer per line represents the maximum profit that 33DAI can obtain.
100 3100 1388
190 390 290 220
one hundred and twenty-four thousand
Example 1 Explanation
The corresponding revenue for the three sales plans is $12400069400109000, so the first sales plan is chosen.
This example is the price tested by 33DAI in a real game. The options for 33DAI are lime and peach jam for sale, and apples roasted and sold. Bananas were left to eat on their own due to their high efficiency in restoring physical energy. Of course, the 33DAI in this question is quite clumsy, and I definitely can't come up with such a perfect solution.
Data scale and agreement
For data of , Ensure that is a multiple of .
-Subtask 1 ($30 points): Ensure the highest profit from making jam. -Subtask 2 ($30 points): Ensure the highest profit from making salad. -Subtask 3 ($40 points): No special restrictions.
What is a subtask?: Each subtask will have a certain number of test points, and you can only receive the score for the current subtask after passing all the test points of the current subtask.