The strongest master in the world, Gudako, is always busy battling in specific points. Today, as
usual, she summoned her most favorite servant Alash to fight against her enemies.
With the help of Kong Ming and Merlin, Alash can use his famous noble phantasm Stella
immediatly, and before that Irisviel will make sure the big hero will not die for the deadly attack.
That’s a good circulation, because it means Alash can make powerful enough attack every turn.
Now the question comes to Gudako. There are three kinds of buffs for attack, magic and noble
phantasm(assume they are called “a”,“b”,“c”), and in each turn she can choose one kind of buff to
put on Alash, then the buff will exist for three turns(if it’s the k-th turn now, it will exist until
the end of k + 2-th turn).
The buff is calculated by the following fomular:
(1 +∑a i )(1 +∑b i )(1 +∑c i )
Where∑a i is the sum of selected buff of type “a”, and∑b i is the sum of selected buff of type“b”, and∑c i is the sum of selected buff of type“c”.
Gudako wants to know how to get the most powerful attack, but she doesn’t want to think about
the choices herself. Alash is so tired, for Merlin and Kong Ming think the question is too easy,
and Irisviel is so beautiful that everyone just want to protect her, so the problem comes to you,
the Grand ACMer. Try to tell Gudako the answer. The original attack is 1.