Given two sorted arrays A and B, and another value k, print the kth element of the resultant sorted array.
A: [1, 2, 3, 4, 5, 6]
B: [3, 4, 4, 5, 6, 6]
Result: [1, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6]
3rd element in the array is 3.
6th element in the array is 4.
The first line contains an integer ‘T’ denoting the number of independent test cases.
For each test case, the input has four lines:
For each test case, print the kth smallest number in the merged array.
2
4 4
1 2 3 4
2 3 4 5
3
4 5
1 1 2 3
3 3 4 5 6
5
2
3
1 <= T <= 100
1 <= n, m <= 10000
1 <= Ai, Bi <= 100000
1 <= k <= n+m