#NINJA7. TWO SEQUENCES PROBLEM
TWO SEQUENCES PROBLEM
Given two lists A and B having the same length, find the length of longest subsequence of list A, whose sum is greater than or equal to the corresponding subsequence of list B. Corresponding subsequence means indices chosen in both of the lists must be the same.
Input
The first line contains an integer T, the number of test cases.
Then for each test case, there are 3 lines.
The first line has an integer N, the number of elements in the lists A and B.
The second line contains N integers of the list A.
The third line contains N integers of the list B.
Output
For each test case, print the answer in a single line.
Constraints
<p1 <="" t="" 501 ≤ N ≤ 105
0 ≤ A[i] ≤ 107
0 ≤ B[i] ≤ 107
Sample
</p>Input: 1 3 100 100 5 2 2 1000 Output: 2