#C5888. Employee Bonus Calculation

    ID: 49586 Type: Default 1000ms 256MiB

Employee Bonus Calculation

Employee Bonus Calculation

You are given the performance scores of various employees from several projects. Your task is to calculate the bonus for each employee according to the following rules:

For each project score:

  • If the score is at least \(90\), the employee earns \( $100 \) bonus.
  • If the score is between \(80\) and \(89\) (inclusive), the employee earns \( $50 \) bonus.
  • If the score is between \(70\) and \(79\) (inclusive), the employee earns \( $20 \) bonus.
  • Scores below \(70\) earn no bonus.

The final bonus for an employee is the sum of the bonus from every project.

Note: You need to read the input from standard input and output the results to standard output.

inputFormat

The input starts with an integer \(T\) representing the number of employees. For each employee, the input is given in the following order:

  1. A line with the employee's name.
  2. A line with an integer \(N\) representing the number of projects.
  3. A line with \(N\) space-separated integers representing the scores of the projects.

For example:

3
Alice
5
92 85 78 88 99
Bob
4
60 70 80 90
Charlie
5
100 60 75 85 90

outputFormat

For each employee, print a single line containing the employee's name and their total bonus separated by a space. The order of the output lines should be the same as the order of input.

For example:

Alice 320
Bob 170
Charlie 270
## sample
3
Alice
5
92 85 78 88 99
Bob
4
60 70 80 90
Charlie
5
100 60 75 85 90
Alice 320

Bob 170 Charlie 270

</p>