import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.PrintStream; import java.util.Map; import java.util.Scanner; import java.util.HashMap; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); Yuki0058 solver = new Yuki0058(); solver.solve(1, in, out); out.close(); } static class Yuki0058 { public void solve(int testNumber, Scanner in, PrintWriter out) { int N = in.nextInt(); int K = in.nextInt(); Map dp = new HashMap<>(); dp.put(0, 1L); for (int cnt = 0; cnt < N; cnt++) { Map ndp = new HashMap<>(); int[] taro; if (cnt < K) { taro = new int[]{4, 5, 6, 4, 5, 6}; } else { taro = new int[]{1, 2, 3, 4, 5, 6}; } for (int key : dp.keySet()) { long now = dp.get(key); for (int i = 0; i < 6; i++) { for (int e : taro) { int nxtKey = key + e - (i + 1); long nxtVal = ndp.get(nxtKey) == null ? 0 : ndp.get(nxtKey); ndp.put(nxtKey, nxtVal + now); } } } dp = ndp; } double all = 0, win = 0; for (int key : dp.keySet()) { long val = dp.get(key); all += val; if (key > 0) { win += val; } } System.err.println(win + " " + all); out.println(win / all); } } }