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

~/algor $ cat problems/minmax-31-toq-orinlardagi-eng-katta

Largest at odd positions

Easy 1000 ms 128 MB 28%
Share

A positive integer $N$ and $N$ integers are given. Find the largest of the elements at odd positions: $A_{1}, A_{3}, A_{5}, \ldots$.

Choosing the largest only among the elements at odd positions

Input

The first line contains a positive integer $N$. The next line contains $N$ integers $A_{i}$.

Output

One integer.

Note

$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$

Examples

Input #1
7
2 8 5 6 1 9 3
Output #1
5
Input #2
2
-5 4
Output #2
-5

Sign in to submit a solution

Signing up is free and takes a minute.