import java.io.*; import java.util.*; public class Main { static HashSet ans = new HashSet<>(); public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int k = sc.nextInt(); int[][] taro = new int[n + 1][n * 6 + 1]; int[][] jiro = new int[n + 1][n * 6 + 1]; taro[0][0] = 1; jiro[0][0] = 1; for (int i = 1; i <= n; i++) { for (int j = (i - 1) * 1; j <= (i - 1) * 6; j++) { for (int a = 1; a <= 6; a++) { jiro[i][j + a] += jiro[i - 1][j]; } if (i <= k) { for (int a = 4; a <= 6; a++) { taro[i][j + a] += taro[i - 1][j] * 2; } } else { for (int a = 1; a <= 6; a++) { taro[i][j + a] += taro[i - 1][j]; } } } } double sum = 0; double ans = 0; for (int i = 0; i <= n * 6; i++) { ans += sum * taro[n][i]; sum += jiro[n][i]; } ans /= Math.pow(Math.pow(6, n), 2); System.out.println(new java.math.BigDecimal(ans).toPlainString()); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }