There are $$$n$$$ offices and you need to get some signatures from each of them to complete a single form. You're given an array $$$a_1, a_2, \dots, a_n$$$ representing the number of signatures needed from the $$$i$$$-th place to complete the form. You're also given an array $$$b_1, b_2, \dots, b_n$$$ representing the maximum number of signatures in total you can get from the $$$i$$$-th place.
You can also go to the Boss and get at most $$$k$$$ special signatures from him. Each of these signatures has the power to act as a substitute for any other required signature. $$$1$$$ special signature can be used in place of exactly $$$1$$$ other required signature.
Find out the maximum number of forms you can complete.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ $$$\left(1 \leq n \leq 10^5;\ 1 \leq k \leq 10^9\right)$$$ — the number of offices and the number of special signatures granted to you.
The second line of each test case contains $$$n$$$ integers $$$a_i$$$ $$$(1 \leq a_i \leq 10^9)$$$ — the number of signatures needed from the $$$i$$$-th place to complete one form.
The third line of each test case contains $$$n$$$ integers $$$b_i$$$ $$$(1 \leq b_i \leq 10^9)$$$ — the maximum number of signatures in total you can get from the $$$i$$$-th place.
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$10^5$$$.
For each test case, output the maximum number of forms you can complete.
13 12 1 411 3 16
4
| Name |
|---|


