# codeforces 443D Andrey and Problem

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
#include <cmath>
#include <cstdlib>

typedef long long ll;
const int MAXN = 1000 + 100;
double s[MAXN];

bool cmp(const double &a, const double &b){
return a > b;
}

int main(){
int n;
scanf("%d", &n);
for(int i = 0; i < n; ++i){
scanf("%lf", s + i);
}
std::sort(s, s + n, cmp);
double ans = 0, t, tmp;
for(int i = 1; i <= n; ++i){
t = 0;
for(int j = 0; j < i; ++j){
tmp = s[j];
for(int k = 0; k < i; ++k){
if(k == j){
continue;
}
tmp *= (1.0 - s[k]);
}
t += tmp;
}
ans = std::max(ans, t);
}
printf("%.12f\n", ans);
return 0;
}


#### Codeforces 443D Andrey and Problem

2017-05-07 17:22:40

#### CodeForces 443D - Andrey and Problem（贪心）

2017-01-20 22:59:27

#### Codeforces 443D Andrey and Problem【排序+概率dp】

2017-04-09 11:54:48

#### cf442B Andrey and Problem

2014-06-20 16:25:42

#### A Polynomial-time Algorithm for the Change-Making Problem.pdf

2012年11月15日 528KB 下载

#### Andrey and Problem

2014-12-14 20:10:23

#### Codeforces 706C Hard problem(dp+字符串)

2016-08-12 06:17:45

#### Codeforces 442B Andrey and Problem(贪心)

2014-06-30 09:04:30

#### CodeForces - 2C：Commentator problem

2017-08-21 15:24:30

#### Codeforces-954F：Runner's Problem（矩阵快速幂+离散化）

2018-03-25 22:15:19