output_description: Print the probability of having more heads than tails. The output is
  considered correct when the absolute error is not greater than 10^{-9}.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      p_1 p_2 \ldots p_N
attempt: #include<bits/stdc++.h>
  using namespace std;
   
  #define ll long long
  #define ff first
  #define ss second
  #define pb push_back
  #define pf push_front
  #define mp make_pair
  #define pu push
  #define pp pop_back
  #define in insert
  #define MOD 1000000007
  #define endl "\n"
  #define sz(a) (int)((a).size())
  #define all(x) (x).begin(), (x).end()
  #define trace(x) cerr << #x << ": " << x << " " << endl;
  #define prv(a) for(auto x : a) cout << x << ' ';cout << '\n';
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define OTP(s) cout<<s<<endl;
  #define FOR(i,j,k,l) for(int i=j;i<k;i+=l)
  #define REP(i,j) FOR(i,0,j,1)
  inline ll add(ll a, ll b){a += b; if(a >= MOD)a -= MOD; return a;}
  inline ll sub(ll a, ll b){a -= b; if(a < 0)a += MOD; return a;}
  inline ll mul(ll a, ll b){return (ll)((ll) a * b %MOD);}
  typedef vector<ll> vl;
  typedef vector<vl> vvl;
  typedef pair<ll,ll> pll;
  typedef vector<pll> vpll;
  
  ll min(ll a,ll b)
  {
      return a>b?b:a;
  }
  ll max(ll a,ll b)
  {
      return a>b?a:b;
  }
  
  ll n;
  double q[3000][3000];
  double p[10000];
  int main()
  {
      IOS
      cin>>n;
      REP(i,n)
      {
          cin>>p[i+1];
      }
      double prod=1;
  
      q[0][0]=1;
      FOR(i,1,n+1,1)
      {
          prod*=0;
          q[0][i]=prod;
      }
      prod=1;
      REP(i,n)
      {
          prod*=p[i+1];
          q[i+1][0] = prod;
      }
      FOR(i,1,n+1,1)
      {
          FOR(j,1,i+1,1)
          {
              q[i][j] = p[i]*q[i-1][j] + (1-p[i])*q[i-1][j-1];
          }
      }
      // REP(i,n+1)
      // {
      //     REP(j,n+1)
      //     {
      //         cout<<q[i][j]<<" ";
      //     }
      //     cout<<endl;
      // }
      double ans = 0;
      REP(i,(n-1)/2+1)
      {
          ans+=q[n][i];
      }
      cout<<fixed<<setprecision(12)<<ans<<endl;
  }
problem_description: Statement
  
  Let N be a positive odd number.
  
  There are N coins, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N),
  when Coin i is tossed, it comes up heads with probability p_i and tails with
  probability 1 - p_i.
  
  Taro has tossed all the N coins. Find the probability of having more heads
  than tails.
samples: [{"input": "3\n    0.30 0.60 0.80", "output": "0.612\n    \n\nThe probability of each case where we have more heads than tails is as\nfollows:\n\n  * The probability of having (Coin 1, Coin 2, Coin 3) = (Head, Head, Head) is 0.3 \u00d7 0.6 \u00d7 0.8 = 0.144;\n  * The probability of having (Coin 1, Coin 2, Coin 3) = (Tail, Head, Head) is 0.7 \u00d7 0.6 \u00d7 0.8 = 0.336;\n  * The probability of having (Coin 1, Coin 2, Coin 3) = (Head, Tail, Head) is 0.3 \u00d7 0.4 \u00d7 0.8 = 0.096;\n  * The probability of having (Coin 1, Coin 2, Coin 3) = (Head, Head, Tail) is 0.3 \u00d7 0.6 \u00d7 0.2 = 0.036.\n\nThus, the probability of having more heads than tails is 0.144 + 0.336 + 0.096\n+ 0.036 = 0.612.\n\n* * *"}, {"input": "1\n    0.50", "output": "0.5\n    \n\nOutputs such as `0.500`, `0.500000001` and `0.499999999` are also considered\ncorrect.\n\n* * *"}, {"input": "5\n    0.42 0.01 0.42 0.99 0.42", "output": "0.3821815872"}]