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

~/algor $ cat problems/minmax-10-birinchi-ekstremal-element

First extreme element

Easy 1000 ms 256 MB 25%
Share

A positive integer $N$ and $N$ integers are given. Find the position of the extreme (that is, minimum or maximum) element that occurs first in the sequence.

The position of the first extreme element of a sequence

Input

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

Output

One integer — the position of the first extreme element.

Note

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

Examples

Input #1
5
4 2 8 1 9
Output #1
4
Input #2
4
10 3 10 3
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.