#include using namespace std; using ll = long long; using ld = long double; using V = vector; using Vll = vector; using Vld = vector; using Vbo = vector; using VV = vector; using VVll = vector; using VVld = vector; using VVbo = vector; using VVV = vector; using VVVll = vector; using VVVld = vector; using P = pair; using Pll = pair; using Pld = pair; #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define rep(i, n) rep2(i, 0, n) #define drep(i, n) drep2(i, n, 0) #define all(a) (a).begin(), (a).end() struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; template inline int sz(T &x) { return x.size(); } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template ostream &operator<<(ostream &os, const pair &p) { os << '(' << p.first << ", " << p.second << ')'; return os; } template istream &operator>>(istream &is, vector &v) { for (auto &e : v) is >> e; return is; } template ostream &operator<<(ostream &os, const vector &v) { for (auto &e : v) os << e << ' '; return os; } template inline int count_between(vector &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r) inline int fLog2(const int x) { assert(x > 0); return 31-__builtin_clz(x); } // floor(log2(x)) inline int fLog2(const ll x) { assert(x > 0); return 63-__builtin_clzll(x); } inline int cLog2(const int x) { assert(x > 0); return (x == 1) ? 0 : 32-__builtin_clz(x-1); } // ceil(log2(x)) inline int cLog2(const ll x) { assert(x > 0); return (x == 1) ? 0 : 64-__builtin_clzll(x-1); } inline int popcount(const int x) { return __builtin_popcount(x); } inline int popcount(const ll x) { return __builtin_popcountll(x); } void fail() { puts("-1"); exit(0); } // const int INF = 1<<30; // const ll INFll = 1ll<<62; // const ld EPS = 1e-10; // const ld PI = acos(-1.0); // const int MOD = int(1e9)+7; // const int MOD = 998244353; V convert(ll x, int b, int n) { V res; for (int i = 0; i < n; ++i) { res.push_back(x%b); x /= b; } return res; } int main() { int n; cin >> n; V a(n); cin >> a; Vld b(n); rep(i, n) b[i] = ld(1) / a[i]; int N = 1; rep(i, n) N *= 3; VVld p(2, Vld(N, -1)); rep(S, N) { V v = convert(S, 3, n); bool ini = true; rep(i, n) if (v[i] == 0) ini = false; if (!ini) { p[0][S] = 0; p[1][S] = 1; continue; } V s(2); rep(i, n) s[v[i]-1] += a[i]; if (s[0] <= s[1]) p[0][S] = 0, p[1][S] = 0; else p[0][S] = 1, p[1][S] = 1; } V pw3(n); pw3[0] = 1; rep(i, n-1) pw3[i+1] = pw3[i] * 3; drep(S, N) { V v = convert(S, 3, n); rep(i, n) if (v[i] == 0) { ld cmin = 1; rep(j, n) if (v[j] == 0) { int x = S + pw3[i]; int y = S + pw3[j] * 2; ld now = p[1][x] * b[i] + p[0][y] * (1-b[i]) * b[j]; now /= 1 - (1-b[i]) * (1-b[j]); chmin(cmin, now); } chmax(p[0][S], cmin); } rep(j, n) if (v[j] == 0) { ld cmax = 0; rep(i, n) if (v[i] == 0) { int x = S + pw3[i]; int y = S + pw3[j] * 2; ld now = p[0][y] * b[j] + p[1][x] * (1-b[j]) * b[i]; now /= 1 - (1-b[i]) * (1-b[j]); chmax(cmax, now); } chmin(p[1][S], cmax); } } cout << p[0][0] << '\n'; return 0; }