import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static double[] DP(final int SIZE, double[] base, final int N, int[] dice){ if(base == null){ base = new double[SIZE + 1]; base[0] = 1; } double[] next = new double[SIZE + 1]; for(int i = 0; i < N; i++){ Arrays.fill(next, 0); for(int current = 0; current <= SIZE; current++){ for(final int d : dice){ if(current + d > SIZE){ break; } next[current + d] += base[current] / 6.0; } } { double[] tmp = base; base = next; next = tmp; } } return base; } public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int K = sc.nextInt(); final int SIZE = N * 6; double[] large_DP = DP(SIZE, DP(SIZE, null, N - K, new int[]{1, 2, 3, 4, 5, 6}), K, new int[]{4, 4, 5, 5, 6, 6}); double[] normal_DP = DP(SIZE, null, N, new int[]{1, 2, 3, 4, 5, 6}); //System.out.println(Arrays.toString(large_DP)); double[] sum_large_DP = new double[SIZE + 1]; for(int i = SIZE - 1; i >= 0; i--){ sum_large_DP[i] += (sum_large_DP[i + 1] + large_DP[i + 1]); } //System.out.println(Arrays.toString(sum_large_DP)); double answer = 0; for(int i = 0; i <= SIZE; i++){ answer += normal_DP[i] * sum_large_DP[i]; } System.out.printf("%.8f\n", answer); } }