Jump Trip Score#13064

Jump Trip Score

2 seconds
256 megabytes

You are given an array consisting of elements numbered 1,2,...,n.

you will start a trip which begins from i = 1 and ends when you reach i = n+1.

you start with a score c = 0 , and during the trip you can do the following.

Find the maximum score you can obtain if you can perform the jump operation at most once.

Input

The first line contains a single integer (1 \le t \le 10^4) — the number of test cases.

The first line of each test case contains a single integer (1 \le n \le 4 \cdot 10^5) — the length of array .

The second line of each test case contains integers a_1 , a_2 , ... , a_n (-10^9 \le a_i \le 10^9) — the array .

It's guaranteed that the sum of over all test cases does not exceed 4 \cdot 10^5.

Output

For each test case, output a single integer , the maximum score you can obtain.

Examples

Example 1

Loading
Loading

Note

In the first test case, it is optimal to add all elements, so the final score equals 1 + 2 + 3 + 4 + 5 = 15.

In the second test case, you can do the following :

i=1 , add to the score, and move to i=2.

i=2 , choose d=3, perform a jump to i = 5, and finish the trip.

So the final score equals .

Scoring

  • Subtask ( points): 0 \le a_i for all (1 \le i \le n).

  • Subtask ( points): \sum n \le 20.

  • Subtask ( points): \sum n \le 5000.

  • Subtask ( points): No additional constraints.