This is a bonus 30 mark question for those of you who are still stuck with many other problems and have given up and need some encouragement (: (:
Anyway, here is the problem description:
Little JiaLing once more is an avid MapleStory fan and wants to know the maximum damage he can deal to a monster. In this MapleStory, Little JiaLing will only play a Pirate character, who can only hold a gun or a knuckle.
The formula for calculating that is below:
Weapon Multiplier * ((4 * Primary Stat) + Secondary Stat) * (Attack / 100)
For a gun (G), the weapon multiplier is 1.6
For a knuckle (K), the weapon multiplier is 1.7.
Attack is based on the equipment he is wearing. He wears only 4 equipments that will give him attack, his weapon, his glove, his cape and his ring. The Attack is the sum of all these weapons.
The first line of input contains a character, representing the weapon he is using (G or K)
The second line of input contains two integers, representing his Pimary Stat and Secondary Stat
The third line of input contains four integers, representing the Attack given by the 4 equipments
Output the maximum damage Little JiaLing can hit to two decimal places.
To do that, do this before you output your double.
cout << fixed << setprecision(2);
Sample Input 1
80 10 1 5
Sample Output 1
This value is gotten from 1.6*(4*100+30)*((80+10+1+5)/100)