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 <bits/stdc++.h>
using namespace std;
using ll = long long;
#define repl(i,a,b) for(int (i)=(int)a;(i)<(int)(b);++(i))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cerr<<#x<<"="<<x<<endl

long double cnt[44][44];
long double dp[44][44];

long double calc(int m,int n,int x){
    long double p1=(long double)m/(long double)(m+n);
    long double p2=(long double)n/(long double)(m+n);

    rep(i,44)rep(j,44)dp[i][j]=cnt[i][j]=0;
    cnt[0][0]=1;
    rep(h,x){
        rep(l,h+1){
            int r=h-l;
            long double d=pow(p1,l)*pow(p2,r);
            {
                cnt[l+1][r]+=cnt[l][r];
                dp[l+1][r]+=dp[l][r];
            }
            {
                cnt[l][r+1]+=cnt[l][r];
                dp[l][r+1]+=dp[l][r]+d*p1*cnt[l][r];
            }
        }
    }

    long double res=0;
    rep(l,x+1){
        int r=x-l;
        res+=pow(p1,l)*pow(p2,r)*(dp[l][r]+cnt[l][r]*pow(p1,l)*pow(p2,r));
    }
    return res;
}

int main(){
    int M,N,X,K,L,Y;
    cin>>M>>N>>X>>K>>L>>Y;
    long double a=calc(N,M,X);
    long double b=calc(L,K,Y);
    printf("%.10Lf\n",a*b);

    return 0;
}