Problem Statement
Let rmcomb(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a1,a2,...,an, select two numbers ai>aj so that rmcomb(ai,aj) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
Constraints
- 2leqnleq105
- 0leqaileq109
- a1,a2,...,an are pairwise distinct.
- All values in input are integers.
Input is given from Standard Input in the following format:
n
a1 a2 ... an
Output
Print ai and aj that you selected, with a space in between.
5
6 9 4 2 11
Sample Output 1
11 6
rmcomb(ai,aj) for each possible selection is as follows:
- rmcomb(4,2)=6
- rmcomb(6,2)=15
- rmcomb(6,4)=15
- rmcomb(9,2)=36
- rmcomb(9,4)=126
- rmcomb(9,6)=84
- rmcomb(11,2)=55
- rmcomb(11,4)=330
- rmcomb(11,6)=462
- rmcomb(11,9)=55
Thus, we should print 11 and 6.
2
100 0
Sample Output 2
100 0