#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER #include #endif #define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i) #define rep(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define REV(v) v.rbegin(), v.rend() #define MEMSET(v, s) memset(v, s, sizeof(v)) #define UNIQUE(v) (v).erase(unique(ALL(v)), (v).end()) #define MP make_pair #define MT make_tuple using namespace std; typedef long long ll; typedef long double ld; typedef pair P; double dp[20][20]; double p[3]; double rec(int n, int rem){ if (!n) return rem; double &res = dp[n][rem]; if (res >= -.5) return res; if (rem == 1) return res = (1 - p[0])*rec(n - 1, rem); res = 0; rep(i, 1 << rem){ double pp = 1; rep(j, rem){ if (i >> j & 1) pp *= j == 0 || j == rem - 1 ? 1 - p[1] : 1 - p[2]; else pp *= j == 0 || j == rem - 1 ? p[1] : p[2]; } double ex = 0; int run = 0; rep(j, rem){ if (i >> j & 1) ++run; else ex += rec(n - 1, run), run = 0; } ex += rec(n - 1, run), run = 0; res += pp*ex; } return res; } int main(){ cin.tie(0); ios::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(20); int n; cin >> n; n = 80 - n; rep(i, 3) cin >> p[i]; rep(i, 3) p[i] /= 100; rep(i, 20) rep(j, 20) dp[i][j] = -1; cout << rec(n, 14) * 2 << endl; }