

day1 = {5, 6, 2}
day2 = {2, 4, 1}
In this case, the ideal order will be to perform work 3 on the first day, work 1 on the second day and work 2 on the fourth day. The order with respect to Day1 in which the work is done will be {2, 5, 6} which is non-decreasing. Hence the number of days needed to finish all work will be 4.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The next ‘3 * T’ lines represent the ‘T’ test cases.
The First line of each test case contains a single integer ‘N’ denoting the number of works to be done.
The second line contains ‘N’ space-separated integers denoting the sequence day1.
The last line contains ‘N’ space-separated integers denoting the sequence day2.
For each test case, return the minimum number of days required to complete the work.
You do not need to print anything; it has already been taken care of. Just implement the given functions.
1 <= T <= 50
0 <= N <= 10^3
1<= day1[i],day2[i] <= 10^9
Time Limit: 1 sec
We can take the Following Approach: