#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; int bitcnt(unsigned int x){ x = (x & 0x55555555) + (x >> 1 & 0x55555555); x = (x & 0x33333333) + (x >> 2 & 0x33333333); x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f); x = (x & 0x00ff00ff) + (x >> 8 & 0x00ff00ff); x = (x & 0x0000ffff) + (x >> 16 & 0x0000ffff); return (int)x; } const int N = 14; vi to[1 << N]; vector pr[1 << N]; double dp[21][1 << N]; int main(){ int A; cin >> A; int Y = 80 - A; double P0, P1, P2; cin >> P0 >> P1 >> P2; P0 *= 0.01; P1 *= 0.01; P2 *= 0.01; rep(S, 1 << N){ bitset b(S); FOR(nS, S, 1 << N)if((S&nS)==S){ bitset nb(nS); double p = 1; rep(i, N){ if(b[i])continue; if((i == 0||b[i-1]) && (i==N-1 || b[i+1])){ if(nb[i])p *= P0; else p *= 1.00 - P0; } else if((i == 0 || b[i - 1]) || (i == N - 1 || b[i + 1])){ if(nb[i])p *= P1; else p *= 1.00 - P1; } else{ if(nb[i])p *= P2; else p *= 1.00 - P2; } } to[S].push_back(nS); pr[S].push_back(p); } } dp[0][0] = 1; rep(y, Y)rep(S, 1 << N){ rep(i, sz(to[S])){ int nS = to[S][i]; double p = pr[S][i]; dp[y + 1][nS] += dp[y][S] * p; } } double ans = 0; rep(S, 1 << N)ans += (N-bitcnt(S))*dp[Y][S]; cout << setprecision(20) << ans*2 << endl; }