#C1392. Calculate Total Earnings
Calculate Total Earnings
Calculate Total Earnings
In this problem, you are given the price of a car (S) and the number of cars sold (C). Your task is to calculate the total earnings after applying a discount based on the number of cars sold. The discount is determined as follows:
- If (1 \leq C \leq 5), then the discount is (0) (i.e. no discount).
- If (6 \leq C \leq 10), then the discount is (5%) (i.e. (0.05)).
- If (11 \leq C \leq 20), then the discount is (10%) (i.e. (0.10)).
- If (C > 20), then the discount is (15%) (i.e. (0.15)).
The final earnings for each test case are calculated using the formula:
[ \text{Earnings} = S \times C \times (1 - \text{discount}) ]
Your solution should read the input from standard input (stdin) and print the answer to standard output (stdout).
inputFormat
The input is read from standard input (stdin). The first line contains an integer (T) representing the number of test cases. Each of the following (T) lines contains two space-separated integers (S) (the price of a car) and (C) (the number of cars sold).
outputFormat
For each test case, output the total earnings (after applying the discount) on a separate line to standard output (stdout).## sample
1
10000 5
50000
</p>