Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-juft-indekslar

Elements at even indices

Easy 1000 ms 128 MB 21%
Share

A positive integer $n$ and an array of $n$ integers are given. Print all elements of the array with even indices ($2, 4, 6, \dots$) in increasing order of index.

Highlighting the array elements at even indices

Input

The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.

Output

One line with the elements at even indices separated by spaces (an empty line if there are none).

Note

$1 \le n \le 1000$
$-10^{9} \le a_{i} \le 10^{9}$

Examples

Input #1
6
7 14 23 8 45 92
Output #1
14 8 92
Input #2
5
10 20 30 40 50
Output #2
20 40

Sign in to submit a solution

Signing up is free and takes a minute.