#K48132. Calculate Character Damage

    ID: 28353 Type: Default 1000ms 256MiB

Calculate Character Damage

Calculate Character Damage

You are given a list of characters. Each character is described by five attributes: role, level, strength, intelligence, and dexterity.

Your task is to calculate two types of damages for each character:

  • Basic Damage
  • Special Damage

The formulas for the damage values are given below in \( \LaTeX \) format:

  • For a Warrior: \( \text{basic_damage} = \text{level} \times 5 \) and \( \text{special_damage} = 30 + \text{strength} \).
  • For a Mage: \( \text{basic_damage} = \text{level} \times 4 \) and \( \text{special_damage} = 25 + \text{intelligence} \).
  • For an Archer: \( \text{basic_damage} = \text{level} \times 3 \) and \( \text{special_damage} = 20 + \text{dexterity} \).

Read the characters' information from standard input and output the result for each character in the order that they appear.

inputFormat

The first line of the input contains an integer n representing the number of characters.

Each of the next n lines contains a character's data:

role level strength intelligence dexterity

Each field is separated by a space. For example:

3
Warrior 5 10 0 0
Mage 3 0 15 0
Archer 4 0 0 8

outputFormat

For each character, output a line with three values separated by a space:

role basic_damage special_damage

Each output line corresponds to the character with the same order as the input.

## sample
3
Warrior 5 10 0 0
Mage 3 0 15 0
Archer 4 0 0 8
Warrior 25 40

Mage 12 40 Archer 12 28

</p>