#C8585. Truck Fuel Expense Calculator

    ID: 52583 Type: Default 1000ms 256MiB

Truck Fuel Expense Calculator

Truck Fuel Expense Calculator

You are given the number of trucks, the distance each truck travels, its mileage (i.e., the distance it can travel per gallon), and the cost of fuel per gallon. For each truck, compute the daily fuel expense using the formula:

$$Expense = \frac{Distance}{Mileage} \times Fuel\ Cost $$

Round each expense to two decimal places.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer T, the number of trucks.
  • The next T lines each contain two floating-point numbers representing the distance traveled and the mileage of a truck, respectively.
  • The last line contains a floating-point number representing the fuel cost per gallon.

outputFormat

Output to standard output (stdout) T lines. Each line should contain the daily fuel expense for a truck, rounded to two decimal places.## sample

3
120.0 15.0
200.0 20.0
50.0 10.0
3.5
28.00

35.00 17.50

</p>