Largest value - MarisaOJ: Marisa Online Judge

Largest value

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers, find the largest value and its position of occurrence. If there are multiple occurrences of the largest value, output the position of the first occurrence. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_1,A_2,...,A_n$. ### Output - Output two integers: the first integer is the largest value, and the second integer is the position of its occurrence. ### Constraints - $1 \le n \le 10^5$. - $1 \le A_i \le 10^9$. ### Sample test ``` 4 3 2 2 3 ``` Output: ``` 3 1 ```