You are given an integer sequence of length . Its elements are numbered from left to right.
While at least two elements remain, you may perform the following operation.
For example, if the current sequence is and you choose , only the elements at positions , , and remain. The sequence becomes . If you then choose again, only , the element at , remains. You may choose a new value of for each operation. The values of the elements do not change.
Perform operations until exactly one element remains. Find the largest possible value of that final element. If initially, perform no operations.
The input is given in the following format.
For each test case, print the largest possible value of the final remaining element on its own line.
First, choose to keep the elements at positions , , and , obtaining . Renumber the remaining elements and choose . Only , the element at position in the current sequence, remains. Thus, two operations can leave , which is the maximum possible value.
is the number of test cases.
Each test case is given in the following format.
The first line contains the length of the sequence. The second line contains integers , separated by spaces.
| 2 | 16 | . |
| 3 | 57 | No additional constraints. |
For the first test case: Choosing leaves only . The final answer may be negative. For the second test case, choosing leaves only .
There is only one element initially, so perform no operations.
Choosing leaves only the last element, .