Problem: Notes

For this problem, it is recommended to use floating point numbers, which are more accurate than double.



Input


m n x
k l y


For input, six integers m, n, x, k, l, y are given in the above input format.
These six integers correspond to those in the problem statement, repeating the horizontal m: n cut x times and the vertical k: l cut y times.
1 ≤ m, n, k, l ≤ 100, 0 ≤ x, y ≤ 40, and m, n and l, k are relatively prime.

Output

Print out the expected number of planarians that are regenerating to their original form after a few weeks in a row.
The output is acceptable with an error of 10-6 or less.

Examples

Input

1 1 1
1 1 1


Output

0.562500


Input

1 2 2
1 1 1


Output

0.490741


Input

1 2 0
3 4 0


Output

1.000000

Solution (in CPP):

Solution:
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) 
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }



const int MAX_C = 110;
long double Com[MAX_C][MAX_C];

void calc_com() {
    for (int i = 0; i < MAX_C; ++i) for (int j = 0; j < MAX_C; ++j) Com[i][j] = 0;
    Com[0][0] = 1;
    for (int i = 1; i < MAX_C; ++i) {
        Com[i][0] = 1;
        for (int j = 1; j < MAX_C; ++j) {
            Com[i][j] = Com[i-1][j-1] + Com[i-1][j];
        }
    }
}


long double vpm[210], vpn[210], vpk[210], vpl[210];
int m, n, x, k, l, y;

int main() {
    //freopen( "/Users/macuser/Dropbox/Contest/input.in", "r", stdin );
    
    calc_com();
    while (cin >> m >> n >> x >> k >> l >> y) {
        long double pm = (long double)(m)/(m+n);
        long double pk = (long double)(k)/(k+l);
        
        vpm[0] = 1, vpn[0] = 1, vpk[0] = 1, vpl[0] = 1;
        for (int i = 1; i < 210; ++i) {
            vpm[i] = vpm[i-1] * pm;
            vpn[i] = vpn[i-1] * (1.0 - pm);
            vpk[i] = vpk[i-1] * pk;
            vpl[i] = vpl[i-1] * (1.0 - pk);
        }
        
        long double d1 = 0, d2 = 0;
        for (int i = x-1; i >= 0; --i) {
            long double tmp = 0;
            for (int j = 0; j <= i; ++j) {
                long double f = vpm[(i-j)*2+1] * vpn[j*2+1];
                f *= Com[i][j];
                
                tmp += f;
                //cout << i << ", " << j << " : " << f << endl;
            }
            d1 += tmp;
        }
        for (int i = y-1; i >= 0; --i) {
            long double tmp = 0;
            for (int j = 0; j <= i; ++j) {
                long double f = vpk[(i-j)*2+1] * vpl[j*2+1];
                f *= Com[i][j];
                
                tmp += f;
                //cout << i << ", " << j << " : " << f << endl;
            }
            d2 += tmp;
        }
        long double res = (long double)(1.0) - d1 - d2 + d1 * d2;
        
        cout << fixed << setprecision(9) << res << endl;
    }
    return 0;
}