import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); // dp1[i][j]は普通のさいころをi+1個投げて和がjとなる確率 double[][] dp1 = new double[N][6 * N + 1]; // dp2[i][j]はイカサマさいころをmin(K, i+1)個、普通のさいころをi+1-min(K, i+1)個投げて和がjとなる確率 double[][] dp2 = new double[N][6 * N + 1]; for(int j = 1; j <= 6; j++) { dp1[0][j] = (double)1 / (double)6; } for(int i = 1; i < N; i++) { for(int j = 0; j < 6 * N + 1; j++) { for(int k = 1; k <= 6; k++) { if(j - k > 0) dp1[i][j] += (double)1 / (double)6 * dp1[i - 1][j - k]; } } } if(K > 0) { for(int j = 4; j <= 6; j++) { dp2[0][j] = (double)1 / (double)3; } } else { for(int j = 1; j <= 6; j++) { dp2[0][j] = (double)1 / (double)6; } } for(int i = 1; i < N; i++) { for(int j = 0; j < 6 * N + 1; j++) { if(i < K) { for(int k = 4; k <= 6; k++) { if(j - k > 0) dp2[i][j] += (double)1 / (double)3 * dp2[i - 1][j - k]; } } else { for(int k = 1; k <= 6; k++) { if(j - k > 0) dp2[i][j] += (double)1 / (double)6 * dp2[i - 1][j - k]; } } } } double ans = 0; for(int j1 = 1; j1 < 6 * N + 1; j1++) { for(int j2 = 1; j2 < j1; j2++) { ans += dp1[N - 1][j2] * dp2[N - 1][j1]; } } System.out.println(ans); } }