#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int v, w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int main() { int A; cin >> A; vector p(3); cin >> p[0] >> p[1] >> p[2]; p[0] /= 100; p[1] /= 100; p[2] /= 100; vector > a(1 << 14); for (int S = 0; S < (1 << 14); S++) { int T = S; do { double& x = a[S][T]; x = 1; for (int i = 0; i < 14; i++) { if (!((S >> i) & 1)) continue; int cnt = 0; if (i - 1 >= 0 && (S >> (i - 1)) & 1) cnt++; if (i + 1 < 14 && (S >> (i + 1)) & 1) cnt++; if ((T >> i) & 1) x *= (1 - p[cnt]); else x *= p[cnt]; } T = (T - 1) & S; } while (T != S); } vector dp(1 << 14); dp[(1 << 14) - 1] = 1; for (; A < 80; A++) { vector _dp(1 << 14); for (int S = 0; S < (1 << 14); S++) { int T = S; do { _dp[T] += dp[S] * a[S][T]; T = (T - 1) & S; } while (T != S); } dp = _dp; } double ans = 0; for (int S = 0; S < (1 << 14); S++) { int cnt = 0; for (int i = 0; i < 14; i++) if ((S >> i) & 1) cnt++; ans += dp[S] * cnt; } printf("%.10f\n", ans * 2); }