#C9622. New Employee Salary Calculation
New Employee Salary Calculation
New Employee Salary Calculation
In this problem, you are given an employee's current salary, performance rating, and years of service. You must compute the new salary based on the following criteria:
- If the rating is 1, no increase is applied.
- If the rating is 2, a 2% increase is applied if the employee has at least 2 years of service; otherwise, a 1% increase is applied.
- If the rating is 3, a 3% increase is applied if the employee has at least 3 years of service; otherwise, a 1% increase is applied.
- If the rating is 4, a 4% increase is applied if the employee has at least 5 years of service; otherwise, a 1% increase is applied.
- If the rating is 5, a 5% increase is applied if the employee has at least 5 years of service; otherwise, a 1% increase is applied.
The new salary is computed using the formula:
\( \text{new_salary} = \text{current_salary} \times \left(1 + \frac{\text{increase_percentage}}{100} \right) \)
The program will read input from standard input (stdin) and print the results to standard output (stdout).
inputFormat
The input contains multiple test cases. Each test case begins with an integer n that represents the number of employee records. The following n lines each contain three space-separated integers: the current salary, the performance rating, and the years of service. The input is terminated by a line where n is 0. All input is given via standard input (stdin).
outputFormat
For each employee record, output the new salary on a separate line. The result should be printed to standard output (stdout).
## sample2
50000 3 4
40000 4 6
0
51500
41600
</p>