405180: GYM101810 H Making Friends

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Making Friendstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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?

Input

The 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.

Output

For each test case, print a single line containing the maximum happiness level of a pair among all matched pairs.

ExampleInput
1
3
2 4 5 6 7 8
Output
11

加入题单

上一题 下一题 算法标签: