#K59702. Total Cost for Cows
Total Cost for Cows
Total Cost for Cows
You are given T test cases. For each test case, there are three integers: N, P, and Q. The task is to calculate the total cost for N cows, where the cost for each cow is the sum of P and Q. In other words, the total cost is given by the formula:
\(\text{Cost} = N \times (P + Q)\)
You should read the input from stdin
and write the outputs to stdout
, with each result on a new line.
inputFormat
The first line of input contains an integer T, the number of test cases. Each of the next T lines contains three space-separated integers: N, P, and Q.
outputFormat
For each test case, output a single line with the total cost calculated using the formula (N \times (P + Q)).## sample
3
2 300 50
3 400 70
1 500 100
700
1410
600
</p>