시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 8 | 0 | 0 | 0.000% |
The Xyz Bank in Afghanistan is having trouble with their customer. Around the end of each month when government employees' salaries are deposited into their accounts, too many will come to withdraw money from their accounts. The bank has a problem with managing the counter queues. They want their customers to stay less time waiting in the queue. Write a program and help the bank with their problem.
Note:
The first line contains the number of test cases (T): 0 < T < 100
For each test case, print the approximate number of minutes that it will take to process all customers.
1 2 5 0 1 0 2 0 3 2 4 1 5
9
There is only one test case, which has 2 counters and 5 customers. Each customer has an approximate estimation about how long it will take to process her/his request. If we enqueue all of them into the counters, we will have the following order:
Each time a customer arrives s/he is added to the smallest queue. It will take 9 minutes to process all customers (from the first moment the first customer arrives, until the last one is processed).