Battle Droid Price
InterviewTime limit1sMemory limit128 MB
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.
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 , , , , .
- : the number of blaster rifles needed
- : the number of visual sensors needed
- : the number of auditory sensors needed
- : the number of arms needed
- : 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.