#C2608. Employee Bonus Calculation

    ID: 45943 Type: Default 1000ms 256MiB

Employee Bonus Calculation

Employee Bonus Calculation

You are given information about employees in a company. For each employee, you are provided with the base salary and a performance score. Your task is to calculate the bonus for each employee based on their performance according to the following rules:

  • If the performance score \(s\) satisfies \(90 \le s \le 100\), then the bonus is \(20\%\) of the base salary, i.e., \(bonus = base\_salary \times 0.20\).
  • If \(75 \le s \le 89\), then the bonus is \(10\%\) of the base salary, i.e., \(bonus = base\_salary \times 0.10\).
  • If \(50 \le s \le 74\), then the bonus is \(5\%\) of the base salary, i.e., \(bonus = base\_salary \times 0.05\).
  • If the performance score is below 50, no bonus is awarded (i.e., \(bonus = 0\)).

Note that the bonus should be truncated to an integer (i.e., using floor/truncation of the computed value). Read the employee data from standard input and output the bonuses in the same order as input.

inputFormat

The first line contains an integer (N), the number of employees. Each of the following (N) lines contains two space-separated integers: the base salary and the performance score of an employee.

outputFormat

Output a single line with (N) space-separated integers representing the bonus for each employee in the order they were given.## sample

5
5000 95
7000 85
3000 65
8000 45
9000 76
1000 700 150 0 900