#C14340. Sum of Even-Indexed Elements

    ID: 43979 Type: Default 1000ms 256MiB

Sum of Even-Indexed Elements

Sum of Even-Indexed Elements

You are given an array of integers. Your task is to compute the sum of the elements located at even indices (using 0-based indexing) of the array.

For instance, if the array is [1, 2, 3, 4, 5, 6], the elements at even indices are 1, 3, and 5, whose sum is 9.

Please note that if the array is empty, the answer should be 0.

inputFormat

The first line contains an integer n, denoting the number of elements in the array. The second line contains n space-separated integers.

outputFormat

Output a single integer representing the sum of the elements located at even indices.## sample

0
0