#K77552. Calculate Total Bill with Tip
Calculate Total Bill with Tip
Calculate Total Bill with Tip
In this problem, you are given a list of bill amounts. For each bill, you need to calculate the tip based on the following criteria:
- If the bill is less than 50, the tip is 20% of the bill, i.e., $$ tip = 0.2 \times bill $$.
- If the bill is between 50 and 200 (inclusive), the tip is 15% of the bill, i.e., $$ tip = 0.15 \times bill $$.
- If the bill is greater than 200, the tip is 10% of the bill, i.e., $$ tip = 0.1 \times bill $$.
After calculating the tip, the total amount is given by $$ total = \lfloor bill + tip \rfloor $$ where ( \lfloor \cdot \rfloor ) denotes the floor function (rounding down to the nearest integer). Your task is to output the total amounts for each bill.
inputFormat
The input is read from standard input (stdin). The first line contains a single integer ( n ) representing the number of bills. The second line contains ( n ) space-separated integers, each representing a bill amount.
outputFormat
Output the total amount for each bill on a separate line to standard output (stdout).## sample
1
30
36
</p>