题目描述
There are two groups, one of $N$ boys and the other of $N$ girls numbered from $1$ to $N$.
You are given two arrays $A$ and $B$ containing $N$ numbers each, denoting the height of boys and girls in the group.
You have to form $N$ couples, where each couple will consist of $1$ boy and $1$ girl.
Each couple has a LIKENESS VALUE, where
LIKENESS VALUE = height of girl in the couple + height of boy in that couple.
You have to form $N$ couples in such a way that the maximum of LIKENESS VALUE of all the couples is minimum.
Note:- No boy or girl can form more than one couple.
------ Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a single integer $N$:- number of boys and number of girls in the group.
The second line of each test case contains $N$ space-separated integers, denoting the height of $N$ boys.
The third line of each test case contains $N$ space-separated integers, denoting the height of $N$ girls.
------ Output ------
For each test case, print the maximum LIKENESS VALUE in a new line.
------ Constraints ------
$1 ≤ T ≤ 5$
$1 ≤ N ≤ 2*10^{4}$
$1 ≤ A_{i}, B_{i} ≤ 10^{9}$ , for all $1 ≤ i ≤ N $
----- Sample Input 1 ------
1
3
4 5 1
2 2 2
----- Sample Output 1 ------
7
----- explanation 1 ------
You can form couples of boy and girl with index pair $(1,1), (2,2), (3,3)$. So, the Likeness value of the three couples will be $(4+2), (5+2), (1+2) = 6,7,3$. The maximum value will be $7$ and there are no other ways that can minimize the maximum value$(7)$.
输入格式
见题面
输出格式
见题面