You are given two arrays of positive integers $$$a$$$ and $$$b$$$, both of length $$$n$$$. You will perform the following operation exactly $$$n - 1$$$ times:
After performing all operations, there will be exactly $$$1$$$ element remaining in both $$$a$$$ and $$$b$$$. Determine the maximum value of $$$\min(a_1, b_1)$$$ attainable if you perform operations optimally.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each testcase contains an integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the length of the arrays $$$a$$$ and $$$b$$$.
The second line of each testcase contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_{n}$$$ ($$$1 \le a_i \le 2 \cdot n$$$).
The third line of each testcase contains $$$n$$$ integers $$$b_1,b_2,\ldots,b_{n}$$$ ($$$1 \le b_i \le 2 \cdot n$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$.
For each testcase, output the maximum value of $$$\min(a_1,b_1)$$$ attainable.
611232 4 51 3 647 5 4 84 6 7 888 7 13 11 1 10 4 511 11 12 8 9 2 3 13916 1 9 12 5 18 10 10 1614 6 7 11 12 17 18 3 1763 6 12 4 10 122 3 2 7 8 9
1368148
In the first example, we do not need to perform any operations, so the answer is just $$$\min(1, 2)$$$ which is $$$1$$$.
For the second example, we can do the following sequence of moves: