#K65812. Employee Bonus Calculation

    ID: 32281 Type: Default 1000ms 256MiB

Employee Bonus Calculation

Employee Bonus Calculation

In this problem, you are required to compute the bonus for each employee based on their performance metrics.

For each employee, you are given three integers representing their efficiency (e), punctuality (p), and quality (q). The bonus is calculated according to the following rules:

  • If e > 75, p > 80 and q > 85 (i.e., e > 75 ∧ p > 80 ∧ q > 85), then the bonus is 1000.
  • If e > 75 and p > 80 (i.e., e > 75 ∧ p > 80), then the bonus is 800.
  • If p > 80 and q > 85 (i.e., p > 80 ∧ q > 85), then the bonus is 600.
  • If e > 75 and q > 85 (i.e., e > 75 ∧ q > 85), then the bonus is 400.
  • If at least one of the following conditions is satisfied: e > 75, p > 80 or q > 85, then the bonus is 200.
  • If none of the above conditions are met, the bonus is 0.

You will be given the number of employees followed by the performance metrics for each employee. Your task is to compute and output the bonus for every employee.

inputFormat

The first line of input contains a single integer T (1 ≤ T ≤ 105), which represents the number of employees.

Each of the following T lines contains three space-separated integers: efficiency, punctuality, and quality.

outputFormat

Output a single line containing T integers where the i-th integer is the bonus calculated for the i-th employee. The bonuses should be separated by a space.

## sample
3
78 82 88
76 81 70
50 60 65
1000 800 0