~/algor $ cat problems/minmax-9-birinchi-va-oxirgi-max-orni
First and last maximum
Easy
1000 ms
256 MB
24%
A positive integer $N$ and $N$ integers are given. Find the position of the first occurrence of the largest element and the position of its last occurrence.
Input
The first line contains an integer $N$. The next line contains $N$ integers $A_{i}$.
Output
One line with two integers separated by a space: the positions of the first and the last largest elements.
Note
$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$
Examples
Input #1
5 4 8 2 8 5
Output #1
2 4
Input #2
3 1 9 4
Output #2
2 2