Yaman, the proud owner of a spirited Arabian horse, set out on a journey through the enchanting desert. Aware of his horse's hearty appetite, Yaman scattered food dishes along the path, each with its own eating time and position.
The food dishes are numbered from $$$1$$$ to $$$n$$$, and each food dish has two numbers $$$p_i$$$ and $$$t_i$$$, the position and the number of minutes needed to eat the $$$i$$$-th dish respectively.
The horse starts at position $$$0$$$ and it can move forward and can't go back. Also, every step the horse takes forward would consume an additional minute.
As is known, the Arabian horse is intelligent, so it will choose the maximum number of dishes possible to eat during the $$$D$$$-minute journey.
With time ticking away, Yaman aimed to determine the maximum number of dishes his Arabian horse could relish during the journey. Help Yaman determine it.
The first line contains the number of test cases $$$t$$$ $$$( 1 \le t \le 10^{5} )$$$. A description of the test cases follows.
The first line of each test case contains three integers $$$n$$$ $$$( 1 \le n \le 10^{5} )$$$, $$$( 1 \le D \le 10^{9} )$$$ — the number of food dishes and the journey duration in minutes respectively.
The next line contains $$$n$$$ integers $$$p_i$$$ $$$( 1 \le p_i \le 10^{9})$$$ — the position of the $$$i$$$-th dish.
The next line contains $$$n$$$ integers $$$t_i$$$ $$$( 1 \le t_i \le 10^{9})$$$ — the number of minutes needed to eat the $$$i$$$-th dish.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^{5}$$$, and it is guaranteed that all positions $$$p_i$$$ are unique.
For each test case, print the maximum number of dishes that the horse could eat.
25 101 2 3 4 51 1 1 1 25 101 2 3 4 51 1 1 1 1
4 5
| Название |
|---|


