import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { final static double NORMAL[] = {1,2,3,4,5,6}; final static double CHEAT [] = {4,4,5,5,6,6}; public static void main(String[] args) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(r.readLine()); int k = Integer.parseInt(r.readLine()); double tarou[][] = makeDpList(n, k); double jirou[][] = makeDpList(n, 0); double sum = 0d; for(int i=n; i<=6*n; i++) { for(int j=n; j<=6*n; j++) { if(i-j <= 0) break; sum += (tarou[i][n] * jirou[j][n]); } } System.out.println(String.format("%.5f", sum)); } static double[][] makeDpList(int n, int k) { int nN = n - k; double list[][] = new double[n*6+1][n+1]; if(nN > 0) { for(int i=1; i<=6; i++) list[i][1] = 1d/6; } else { for(int i=4; i<=6; i++) list[i][1] = 2d/6; } double d[]; for(int j=2; j<=n; j++) { if(j<=nN) { d = NORMAL; } else { d = CHEAT ; } int y = 6; for(int i=j; i<=j*6; i++) { for(int m=0; m<6; m++) { int rem = i-(int)d[m]; if(rem < 0) continue; list[i][j] += list[rem][j-1]; } if(list[i][j] > 0) list[i][j] /= y; } y *= 6; } return list; } }