oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

maxdamage Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

maxdamage.html

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.

Input

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

Output the maximum damage Little JiaLing can hit to two decimal places.

To do that, do this before you output your double.

#include <iomanip>
cout << fixed << setprecision(2);

Sample Input 1

G
100 30
80 10 1 5

Sample Output 1

660.48
This value is gotten from 1.6*(4*100+30)*((80+10+1+5)/100)

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110061s32MBAverage
2011s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o maxdamage -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.