dp1 = [0] * 61 dp2 = [0] * 61 dp1[0] = dp2[0] = 1 n = int(input()) k = int(input()) for _ in range(n): for i in range(54, -1, -1): for j in range(1, 7): dp1[i+j] += dp1[i] dp1[i] = 0 for _ in range(k): for i in range(54, -1, -1): for j in range(4, 7): dp2[i+j] += dp2[i] * 2 dp2[i] = 0 for _ in range(n-k): for i in range(54, -1, -1): for j in range(1, 7): dp2[i+j] += dp2[i] dp2[i] = 0 for i in range(59, -1, -1): dp2[i] += dp2[i+1] print(sum(dp1[i] * dp2[i+1] for i in range(60)) / 6 ** (2 * n))