A supermarket has two checkouts to collect the products purchased by its customers and, for that reason, there are always two queues, which, however, progress at different speeds, resulting in anger among some customers. Fed up with the situation, the supermarket has decided to implement an algorithm to determine which queue each customer should be placed in, taking into account the estimated time it takes to serve them at the checkout, so that the total time to serve all customers is as short as possible.
There will be several test cases, represented by a number $$$C$$$ on the first line. For each test case, on a single line, the number of customers in total, $$$N$$$, is indicated first, followed by $$$N$$$ numbers indicating the time $$$T$$$ each one takes to be served.
For each test case it is necessary to indicate the time taken by the first and second cashier, respectively, to serve the customers assigned to each of them, so that the difference between the two times is as small as possible. If it does not take the same time, the second cashier will take the longest.
3 3 1 3 1 4 1 3 6 2 6 2 2 3 4 8 11
2 3 6 6 15 15