N = int(input()) K = int(input()) M = 6 * N # 出しうる最大の値 edited = [4,4,5,5,6,6] normal = [1,2,3,4,5,6] def f(X): x = [0] * (M + 1) x[0] = 1 dice = normal for i in range(N): new_x = [0] * (M + 1) for j in range(M + 1): if x[j] == 0: continue if i >= (N - K): # normalを(N - K)回以上使っていたら、Xに切り替える dice = X # print("dice",dice,"を振る") for k in range(6): # print(j + dice[k],"に",x[j] / 6,"の確率で到達") new_x[j + dice[k]] += x[j] / 6 # print("new_x",new_x) x = new_x return x jiro = f(normal) taro = f(edited) ans = 0 jiro_lose = 0 for i in range(len(taro)): ans += taro[i] * jiro_lose jiro_lose += jiro[i] print(ans)