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

~/algor $ cat problems/minmax-22-modul-boyicha-eng-katta

Largest by absolute value

Easy 1000 ms 128 MB 31%
Share

A positive integer $N$ and $N$ integers are given. Find the position (indexed from $1$) and the value of the element with the largest absolute value $|A_{i}|$. If there are several such elements, take the first one.

Highlighting the first element with the largest absolute value

Input

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

Output

One line with two integers separated by a space: the position and the value.

Note

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

Examples

Input #1
5
4 -7 3 7 -2
Output #1
2 -7
Input #2
3
2 -2 1
Output #2
1 2

Sign in to submit a solution

Signing up is free and takes a minute.