#K2581. Customer Service Performance Evaluation

    ID: 24768 Type: Default 1000ms 256MiB

Customer Service Performance Evaluation

Customer Service Performance Evaluation

You are tasked with evaluating the performance of customer service representatives. For each dataset, you need to determine which employee(s) performed well. An employee is considered to have a "Good" performance if they satisfy both of the following conditions:

  • The ratio of satisfactory responses to total responses is greater than \(\frac{3}{4}\) (i.e. \(\frac{\text{satisfactory}}{\text{total}} > 0.75\)).
  • Their average response time is at most 300.

You will be given multiple datasets. For each dataset, if at least one employee meets these conditions, output their IDs in increasing order separated by a single space; otherwise, output NA. The input terminates when a dataset with 0 records is encountered (this dataset should not be processed).

inputFormat

The input consists of multiple datasets. For each dataset:

  1. The first line contains an integer n (\(n \ge 0\)), the number of records in the dataset.
  2. If n is not 0, the next n lines each contain three integers separated by spaces: employee_id, response_time, and satisfaction (where satisfaction is either 0 or 1).

The dataset with n = 0 marks the end of input and should not be processed.

outputFormat

For each processed dataset, output a single line:

  • If there is at least one employee who satisfies both conditions (\(\frac{\text{satisfactory}}{\text{total}} > 0.75\) and average response time \(\le 300\)), output their employee IDs in increasing order separated by a space.
  • If no employees satisfy the criteria, output NA.
## sample
3
1001 250 1
1002 310 0
1001 290 1
2
1003 200 1
1003 400 0
1
1004 199 1
0
1001

NA 1004

</p>