代码如下
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<cmath>
using namespace std;
int main()
{
int n;
while(~scanf("%d",&n)) {
priority_queue<double> q;
for(int i=0;i<n;i++){
double temp;
scanf("%lf",&temp);
q.push(temp);
}
while(q.size()>1) {
double t1=q.top();
q.pop();
double t2=q.top();
q.pop();
q.push(2*sqrt(t1*t2));
}
printf("%.3f\n",q.top());
}
}