~/algor $ cat problems/minmax/largest-number-in-an-interval
Largest number in an interval
Easy
1000 ms
256 MB
30%
A positive integer , two integers and and integers are given. Among the numbers strictly inside the interval , find the largest one and the position of its first occurrence (if there is no such number, print 0 0).
Input
The first line contains three integers: , and . The next line contains integers .
Output
One line with two integers separated by a space: the largest number in the interval and its position (if there is none — 0 0).
Note
Examples
Input #1
5 2 8 1 5 7 4 9
Output #1
7 3
Input #2
4 10 20 5 8 22 25
Output #2
0 0