#C6172. Rohan's Bridge Crossing Points
Rohan's Bridge Crossing Points
Rohan's Bridge Crossing Points
Rohan is attempting to cross a series of bridges. Each bridge carries a score which might be positive or negative. However, Rohan only collects points from every second bridge he crosses (i.e., the 2nd, 4th, 6th, ... bridges). In other words, if the scores on the bridges are given in order as \(a_0, a_1, a_2, \dots, a_{n-1}\), then Rohan's total points are computed as:
\[ S = \sum_{i=1,3,5,\dots}^{n-1} a_i \]
Your task is to determine the total points Rohan collects for each test case.
inputFormat
The first line of input contains an integer \(T\), the number of test cases. Each test case is described by two lines:
- The first line contains an integer \(n\) representing the number of bridges.
- The second line contains \(n\) space-separated integers representing the scores on the bridges.
outputFormat
For each test case, output a single line containing the sum of the scores at odd indices (i.e., the 2nd, 4th, 6th, ... bridges, considering 0-indexing) which represents the total points Rohan collects.
## sample1
5
1 2 3 4 5
6
</p>