#C8911. Average at Even Indices
Average at Even Indices
Average at Even Indices
Given a list of integers, you are to calculate the average of the elements located at even indices (0-indexed). That is, consider the elements at positions 0, 2, 4, etc. If the list is empty, the average is defined as \(0.0\). Use standard input/output methods for reading input and producing output.
inputFormat
The first line contains an integer \(n\), the number of elements in the list. The second line contains \(n\) space-separated integers. If \(n=0\), no further numbers are provided.
outputFormat
Output a single floating point number representing the average of the numbers at even indices. If no such elements exist, output \(0.0\).
## sample5
1 2 3 4 5
3.0
</p>