from itertools import accumulate from collections import defaultdict N = int(input()) K = int(input()) U = 6 * N + 1 p1 = 1 / 3 p2 = 1 / 6 val1 = [4, 5, 6] prob1 = [p1] * 3 val2 = [1, 2, 3, 4, 5, 6] prob2 = [p2] * 6 # taro taro = [0] * U taro[0] = 1 for _ in range(K): newDP = [0] * U for v, p in zip(val1, prob1): for i in range(v, U): newDP[i] += taro[i - v] * p taro = newDP for _ in range(N - K): newDP = [0] * U for v, p in zip(val2, prob2): for i in range(v, U): newDP[i] += taro[i - v] * p taro = newDP # jiro jiro = [0] * U jiro[0] = 1 for _ in range(N): newDP = [0] * U for v, p in zip(val2, prob2): for i in range(v, U): newDP[i] += jiro[i - v] * p jiro = newDP jiro.reverse() jiro_acc = list(accumulate(jiro)) jiro_acc.reverse() ans = sum(t*(1-j) for t, j in zip(taro, jiro_acc)) print(ans)