n = int(input()) K = int(input()) taro = {0:1} for _ in range(n - K): tmp = {} for k, v in taro.items(): for i in range(1, 7): tmp[k + i] = tmp.get(k + i, 0) + v taro = tmp for _ in range(K): tmp = {} for k, v in taro.items(): for i in range(4, 7): tmp[k + i] = tmp.get(k + i, 0) + v * 2 taro = tmp jiro = {0:1} for _ in range(n): tmp = {} for k, v in jiro.items(): for i in range(1, 7): tmp[k + i] = tmp.get(k + i, 0) + v jiro = tmp div = 0 cnt = 0 for k1, v1 in taro.items(): for k2, v2 in jiro.items(): div += v1 * v2 if k1 > k2: cnt += v1 * v2 print(cnt / div)