This page is still under construction.

Parts of this page are still being built. What you see may change.

Battle Droid Price

Interview

Time limit1sMemory limit128 MB

Summary
For each test case, multiply five part quantities by fixed prices, sum them, and print the total with a dollar sign and two decimals.
Level

Easy1 of 10

Topics
Math, Implementation, Array, Brute force
Solved
No attempts yet

Problem

Sanggeun is trying to repair a broken battle droid. The price of each part that makes up a battle droid is as follows.

PartPrice
Blaster rifle$350.34
Visual sensor$230.90
Auditory sensor$190.55
Arm$125.30
Leg$180.90

Given the number of each required part, write a program that computes the total cost of buying all of them.

Input

The first line contains the number of test cases. Each test case consists of five non-negative integers AA, BB, CC, DD, EE.

  • AA: the number of blaster rifles needed
  • BB: the number of visual sensors needed
  • CC: the number of auditory sensors needed
  • DD: the number of arms needed
  • EE: the number of legs needed

Output

For each test case, print the total cost of buying all the given parts, rounded to two decimal places, one per line. Prefix the amount with a dollar sign ($). The answer is always at most 100,000,000.

Examples1

  1. Example 1

    Input
    3
    20 10 14 3 9
    19 17 12 8 10
    11 9 8 22 33
    
    Expected output
    $13987.50
    $15679.76
    $16182.54