PROGRAMMING:Single queue multi window plus VIP service for bank queuing problem
Suppose that the bank has $$k $$windows to provide services, a yellow line is set in front of the window, and all customers form a long line at the back of the yellow line according to the arrival time. When a window is free, the next customer will go to the window to process the transaction. When there are multiple windows to choose from, it is assumed that customers always choose the window with the smallest number.
Some banks will provide VIP customers with various preferential services, such as opening VIP windows. In order to maximize the utilization of resources, the service mechanism of VIP window is defined as: when there are no VIP customers in the queue, the window serves ordinary customers; When the window is idle and there are VIP customers waiting in the queue, the top VIP customers enjoy the service of the window. At the same time, when it's a VIP customer's turn to go out, if the VIP window is not empty, the customer can choose the free ordinary window** Otherwise, you must select the VIP window * *.
This problem requires the output of the average waiting time, the longest waiting time and the final completion time of the $$n customers waiting for service, and the statistics of how many customers are served in each window.
###Input format:
Enter the first line to give a positive integer $$n $$($$Le 1000 $$), which is the total number of customers; Next, $$n $$line, each line gives a customer's arrival time't ', transaction processing time' p 'and whether it is VIP (1 is VIP, 0 is not), and assumes that the input data has been arranged in the order of arrival time; The last line gives the positive integer $$k $$($$Le 10 $$) - the number of business windows opened, and the number of VIP windows (from 0 to $$k-1 $$). Here, it is assumed that the longest time for each customer transaction to be processed is 60 minutes.
###Output format:
In the first line, output the average waiting time (output to 1 decimal place), the longest waiting time and the final completion time, separated by a space, and there should be no extra space at the end of the line.
In the second line, output the number of customers served in each window according to the number increasing order. The numbers are separated by a space, and there should be no extra space at the end of the line.
###Input example:
```in
ten
0 20 0
0 20 0
1 68 1
1 12 1
2 15 0
2 10 0
3 15 1
10 12 1
30 15 0
62 5 1
3 1
```
###Output example:
```out
15.1 35 67
4 5 1
```
answer:If there is no answer, please comment
Some banks will provide VIP customers with various preferential services, such as opening VIP windows. In order to maximize the utilization of resources, the service mechanism of VIP window is defined as: when there are no VIP customers in the queue, the window serves ordinary customers; When the window is idle and there are VIP customers waiting in the queue, the top VIP customers enjoy the service of the window. At the same time, when it's a VIP customer's turn to go out, if the VIP window is not empty, the customer can choose the free ordinary window** Otherwise, you must select the VIP window * *.
This problem requires the output of the average waiting time, the longest waiting time and the final completion time of the $$n customers waiting for service, and the statistics of how many customers are served in each window.
###Input format:
Enter the first line to give a positive integer $$n $$($$Le 1000 $$), which is the total number of customers; Next, $$n $$line, each line gives a customer's arrival time't ', transaction processing time' p 'and whether it is VIP (1 is VIP, 0 is not), and assumes that the input data has been arranged in the order of arrival time; The last line gives the positive integer $$k $$($$Le 10 $$) - the number of business windows opened, and the number of VIP windows (from 0 to $$k-1 $$). Here, it is assumed that the longest time for each customer transaction to be processed is 60 minutes.
###Output format:
In the first line, output the average waiting time (output to 1 decimal place), the longest waiting time and the final completion time, separated by a space, and there should be no extra space at the end of the line.
In the second line, output the number of customers served in each window according to the number increasing order. The numbers are separated by a space, and there should be no extra space at the end of the line.
###Input example:
```in
ten
0 20 0
0 20 0
1 68 1
1 12 1
2 15 0
2 10 0
3 15 1
10 12 1
30 15 0
62 5 1
3 1
```
###Output example:
```out
15.1 35 67
4 5 1
```
answer:If there is no answer, please comment