A
B
#include <bits/stdc++.h>
#define PI acos(-1.0)
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define inf 0x3f3f3f3f
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; get min
const double eps = 1.0e-10;
const double EPS = 1.0e-4;
typedef pair<int, int> pairint;
typedef long long ll;
typedef unsigned long long ull;
//const int maxn = 3e5 + 10;
const int turn[][] = {{, }, { , }, { , -}, { -, }};
//priority_queue<int, vector<int>, less<int>> que;
//next_permutation
int num[];
int main()
{
int n;
cin >> n;
for (int i = ; i <= n; i++)
{
scanf("%d", &num[i]);
}
sort(num + , num + + n);
if (n == )
{
cout << num[] << " " << num[] << endl;
return ;
}
else
{
int minn = 1e9;
cout << num[n] << " ";
int now = num[n] / ;
int now2 = num[n] / + num[n] % ;
for (int i = ; i <= n - ; i++)
{
minn = min(minn, min(abs(num[i] - now), abs(num[i] - now2)));
}
for (int i = ; i <= n - ; i++)
{
if (min(abs(num[i] - now), abs(num[i] - now2)) == minn)
{
cout << num[i] << endl;
return ;
}
}
}
}
C