package no162; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); double p0 = sc.nextInt() / 100.0; double p1 = sc.nextInt() / 100.0; double p2 = sc.nextInt() / 100.0; double[][] dp = new double[21][15]; for(int i=0;i<15;i++) { dp[0][i] = i; } int n = 80 - a; for(int i=1;i<=n;i++) { for(int j=1;j<15;j++) { double e = 0; for(int k=0;k<1<>l&1) == 1); int count = (l == 0 ? 0 : 1) + (l == j - 1 ? 0 : 1); if (count == 0) { p *= nuketa ? p0 : 1 - p0; }else if(count == 1) { p *= nuketa ? p1 : 1 - p1; }else{ p *= nuketa ? p2 : 1 - p2; } } double sum = 0; int seq = 0; for(int l=0;l<=j;l++) { if ((k>>l&1) == 0 && (l < j)) { seq++; }else{ sum += dp[i-1][seq]; seq = 0; } } e += p * sum; } dp[i][j] = e; } } // System.out.println(Arrays.deepToString(dp)); System.out.println(dp[n][14] * 2); } }