405180: GYM101810 H Making Friends
Description
Ali is trying to make his friends happier by matching them into pairs together. In the beginning, Ali has 2 × n friends standing in a row and numbered from 1 to 2 × n. Each friend i will be matched with the friend numbered (2 × n - i + 1).
Each friend i has a happiness level equal to hi. The happiness level of a matched pair of friends i and (2 × n - i + 1) is equal to hi + h2 × n - i + 1.
Your task is to find the maximum happiness level of a pair among all matched pairs. Can you?
InputThe first line contains an integer T (1 ≤ T ≤ 50) specifying the number of test cases.
The first line of each test case contains an integer n (1 ≤ n ≤ 1000), giving that Ali has 2 × n friends. Then a line follows containing 2 × n integers h1, ..., h2 × n (1 ≤ hi ≤ 1000), in which hi represents the happiness level of the ith friend.
OutputFor each test case, print a single line containing the maximum happiness level of a pair among all matched pairs.
ExampleInput1Output
3
2 4 5 6 7 8
11