#C8192. Calculate Final Amount with Discounts
Calculate Final Amount with Discounts
Calculate Final Amount with Discounts
Given a list of amounts, compute the final amount after applying a tiered discount. The discount rates are defined as follows:
- For an amount in the interval \(200.01 \leq amount \leq 500.00\), a discount of \(5\%\) is applied.
- For an amount in the interval \(500.01 \leq amount \leq 1000.00\), a discount of \(10\%\) is applied.
- For an amount greater than \(1000.00\), a discount of \(20\%\) is applied.
- Amounts \(\leq 200.00\) do not receive any discount.
The result for each amount should be rounded to two decimal places.
You are given an integer \(n\) and \(n\) floating point amounts. Compute the final amount after discount for each.
inputFormat
Input is read from stdin. The first line contains an integer \(n\) representing the number of amounts. The second line contains \(n\) floating point numbers separated by spaces.
outputFormat
Output the final discounted amounts on a single line, each rounded to two decimal places and separated by a space. The output should be written to stdout.
## sample1
150.00
150.00
</p>