A pizza house stands at a fixed point on a straight road, and many customer houses lie along that same road. To attract more orders, the owner promises a late-delivery discount: once a fixed grace period has passed after an order is placed, a penalty of 1 won accrues for every unit of time until the pizza is handed over.
Today every house ordered at the same moment, and delivery begins exactly when the grace period ends, so the penalty starts counting from time 0. The owner drives at a speed of one unit of distance per unit of time, and handing a pizza to a customer takes no time.
The profit from serving a customer equals that customer's earning minus the accumulated late penalty, and that penalty equals the time at which the pizza reaches them. On a busy day the owner may skip a customer whenever the penalty would exceed the earning, since serving them would lose money. Decide which customers to serve, and in what order, so that the total profit is as large as possible.
For example, the figure below shows five customers c1,…,c5, their positions relative to the pizza house, and the earning from each.

If the delivery order is ⟨c4,c3,c2,c5,c1⟩, the late penalties are 2 for c4, 5 for c3, 7 for c2, 15 for c5, and 26 for c1, so the per-customer profits are 3,−3,3,5,1. Because serving c3 loses 3, it is better to skip c3, and this order yields a total profit of 12. The best the owner can do for this instance is 32, achieved by the order ⟨c3,c2,c1,c5⟩ (skipping c4).
Given the customers' positions relative to the pizza house and the earning from each, compute the maximum total profit.
The first line contains the number of test cases T. Each test case is given on three lines.
Every integer on the second and third lines lies between −100000 and 100000 inclusive.
For each test case, print a single line containing the maximum total profit obtainable by delivering pizzas to the customers.