#K78007. Apply Bonuses Based on Salary Tiers
Apply Bonuses Based on Salary Tiers
Apply Bonuses Based on Salary Tiers
You are given the salaries of n employees. Your task is to adjust the salaries based on predefined bonus rules:
The bonus is applied as follows:
- If the salary s is less than 5000, then the bonus is $\ 0.10\times s$.
- If the salary s is between 5000 and 20000 (inclusive), then the bonus is $\ 0.05\times s$.
- If the salary s is greater than 20000, no bonus is applied.
For instance, if an employee earns 4000, then the bonus is $0.10 \times 4000 = 400$, making the updated salary 4400. Similarly, for a salary of 6000, the bonus is $0.05 \times 6000 = 300$, so the updated salary becomes 6300.
Output the updated salaries with a precision as demonstrated in the examples.
inputFormat
The first line of input contains an integer n, representing the number of employees. The second line contains n floating-point numbers separated by spaces, each representing an employee's current salary.
outputFormat
Output n floating-point numbers separated by a single space. Each number is the corresponding employee's updated salary after applying the bonus rules.
## sample5
4000 6000 25000 7000 15000
4400.0 6300.0 25000.0 7350.0 15750.0