#include <bits/stdc++.h>
using namespace std;
bool cmp(int lhs,int rhs)
{
return lhs>rhs;
}
int main()
{
int n;
cin>>n;
vector<int> vec;
for(int i=0;i<n;i++)
{
int tmp;
cin>>tmp;
vec.push_back(tmp);
}
vector<double> result(3,0);
result[0] = *max_element(vec.begin(),vec.end());
result[1] = *min_element(vec.begin(),vec.end());
if(n%2==0)
{
result[2] = (vec[n/2]+vec[n/2-1])/2.0;
}
else
result[2] = vec[n/2];
sort(result.begin(),result.end(),cmp);
for(auto ch: result)
{
if(ch == int(ch))
cout<<int(ch)<<" ";
else
cout<<fixed<<setprecision(1)<<ch<<" ";
}
return 0;
}
|