Jon has $$$n$$$ tasks and $$$m$$$ units of time. There are also $$$m$$$ cash prizes, where prize $$$j$$$ is worth $$$v_j$$$ dollars.
Task $$$i$$$ requires a duration of $$$a_i$$$ to complete. If Jon completes task $$$i$$$, he becomes eligible for cash prize $$$p_i$$$ where $$$$$$ p_i = \lfloor\frac{m}{a_i}\rfloor, $$$$$$ receiving $$$v_{p_i}$$$ dollars. If several completed tasks correspond to the same prize, Jon receives that prize only once.
Jon may choose any subset of tasks and complete them in any order, as long as the total time taken by the chosen tasks does not exceed $$$m$$$.
Find the maximum amount of money, in dollars, that Jon can receive today.
The first line contains a single integer $$$t$$$ ($$$1\leq t \leq 300$$$), the number of test cases. For each test case,
$$$t$$$ lines. For each test case, output a single integer: the maximum amount of money, in dollars, that Jon can receive today.
26 101 2 3 4 6 101 5 20 1 30 1 1 1 1 607 122 3 4 5 6 11 121 8 18 35 1 40 1 1 1 1 1 1
115 93
There are two test cases.