Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/minmax/largest-number-in-an-interval

Largest number in an interval

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 256 MB 30%
Share

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).

Finding the largest element lying in a given interval

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

Sign in to submit a solution

Signing up is free and takes a minute.