~/algor $ cat problems/juft-orinlardagi-yigindi
Sum at even positions
Easy
1000 ms
64 MB
29%
A sequence of $n$ integers is given. Find the sum of the numbers at even positions — the $2$nd, $4$th, $6$th, … If there are no such numbers ($n = 1$), the answer is $0$.
Input
The first line contains a positive integer $n$.
The second line contains $n$ integers.
Output
One integer — the sum.
Note
$1 \le n \le 1000$
the numbers are from $-10^{6}$ to $10^{6}$
Examples
Input #1
5 3 8 -2 4 7
Output #1
12
Input #2
1 9
Output #2
0