P15441 [HackerEarth] Tom Dwan has long been considered one of the most aggressive poker players in the world, and his mind-boggling swings are proof. Apparently, he is the most feared poker player at present
普及
题目描述

Tom Dwan has long been considered one of the most aggressive poker players in the world, and his mind-boggling swings are proof. Apparently, he is the most feared poker player at present with a net worth of $ 10 Million. Because of his good guessing power and confidence to rely on it, not only his wins, but his folds are also epic.

One evening while playing poker he made a terrible mistake and lost all the chips to his opponents. In order to get more chips he went to play a game.

There are N pots placed in a circle, ith pot contains Ai number of chips. Dwan can pick any number of the pots, but he is not allowed to choose adjacent pots. What is the maximum number of chips he could collect?

Input

First line contains single integer T denoting the number of test cases.
The first line of each test case contains a single integer N denoting the number of pots.
The second line contains N space-separated integers A1, A2, ..., AN denoting the number of chips in each pot.

Output

For each test case, output a single line containing an integer corresponding to the maximum number of chips he could collect.

Constraints

1 ≤ T ≤ 110

2 ≤ N ≤ 2.5*10^4

1 ≤ Ai ≤ 10^7

Use Fast I/O

SAMPLE INPUT
1
6
25 1 25 1 25 30

SAMPLE OUTPUT
75

Explanation

Maximum chips he could collect is 75 (A1=25,A3=25,A5=25). Pot 6 could not be picked because he had to leave pot 1 for that (as pots are arranged in a circle).

输入格式

见题面

输出格式

见题面

样例输入
10 9 35 991 80 273 637 811 974 845 725 6 10 3 2 5 7 8 2 11 15 7 7 7 7 7 7 7 7 10 1 2 3 4 5 1 2 3 4 5 9 374 429 448 480 751 781 295 920 442 17 15 992 551 28 245 149 647 633 422 137 3 805 177 848 79 878 482 11 874 173 392 916 119 997 923 841 301 755 320 10 918 501 486 579 964 638 396 988 85 503 25 836 100 274 931 632 817 951 992 17 349 189 99 77 316 698 10 732 3 2 445 524 343 953 513 459
样例输出
3327 19 15 21 16 2610 4837 4383 3356 6933 48190298 48172254 48563414 48468383 48445468 48051909 48366533 47994129 47514144 48574390 48227943 48691655 47936575 48250445 47495859 48091105 48038162 47774483 47574834 48758672 48187743 47811209 47242851 47637500 48129591 48339783 48298598 48011901 48173306 47965623 47636883 48067853 47967844 47443924 48054157 48602674 47654836 47884258 48265439 47586368 47947634 48330110 47584503 48142442 48234207 47998247 47768577 48807586 48442117 48195908 48443930 48398494 48129730 48817285 48664363 48425282 47957194 47502956 48147826 48336330 48928479 48154103 47901791 48206714 47713150 47670212 48066452 47508725 47987841 48166395 48741137 47968432 47786315 48022262 48297449 47931327 47336128 48275517 48107581 47879118 48153888 48092300 47837419 47889867 47916095 48202482 48525840 48381500 48184493 48368723 47676060 47673567 48467744 47597496 48477626 48171679 48322803 48206003 48106127 46920651