#CCBCHBA0000023. Cộng số tại vị trí chẵn (Sum Values at Even Positions)
Cộng số tại vị trí chẵn (Sum Values at Even Positions)
Sum Values at Even Positions
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Sum values at 1-based positions 2,4,6,...; the positions, not the values, must be even.
Input
n in [0,100000] followed by n integers in [-1000000,1000000].
Output
64-bit sum; print 0 if no even position exists.
Subtasks
- Subtask 1 (20%): , .
- Subtask 2 (30%): , .
- Subtask 3 (50%): , .
Examples
Example 1
Input
5
8 -3 4 7 2
Output
4
Explanation
Take positions 2 and 4: -3+7=4.
Example 2
Input
1
6
Output
0
Explanation
There is no even position.