Codeforces Round 899 (Div. 2) |
---|
Finished |
There are $$$n$$$ cards stacked in a deck. Initially, $$$a_{i}$$$ is written on the $$$i$$$-th card from the top. The value written on a card does not change.
You will play a game. Initially your score is $$$0$$$. In each turn, you can do one of the following operations:
What is the maximum score you can get when the game ends?
$$$^{\dagger}$$$ An integer $$$i$$$ is odd, if there exists an integer $$$k$$$ such that $$$i = 2k + 1$$$.
$$$^{\ddagger}$$$ An integer $$$i$$$ is even, if there exists an integer $$$k$$$ such that $$$i = 2k$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^{4}$$$). The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^{5}$$$).
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$-10^{9} \le a_i \le 10^{9}$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^{5}$$$.
For each test case, print a single integer — the maximum score you can get when the game ends.
44-4 1 -3 541 -2 3 -43-1 3 -51-1
5 4 2 0
In the first test case, one can get the score of $$$5$$$ as follows:
In the second test case, one can get the score of $$$4$$$ as follows:
In the third test case, one can get the score of $$$2$$$ as follows:
Name |
---|