import itertools N = int(input()) K = int(input()) TARO = [0]*(N*6+2) ZIRO = [0]*(N*6+2) TARO[0]=1 for i in range(K): NTARO=[0]*(N*6+2) for j in range(N*6+2): if TARO[j]>0: NTARO[j+4] = TARO[j]/3 NTARO[j+5] = TARO[j]/3 NTARO[j+6] = TARO[j]/3 TARO = NTARO for i in range(N-K): NTARO=[0]*(N*6+2) for j in range(N*6+2): if TARO[j]>0: NTARO[j+1] += TARO[j]/6 NTARO[j+2] += TARO[j]/6 NTARO[j+3] += TARO[j]/6 NTARO[j+4] += TARO[j]/6 NTARO[j+5] += TARO[j]/6 NTARO[j+6] += TARO[j]/6 TARO = NTARO ZIRO[0]=1 for i in range(N): NZIRO=[0]*(N*6+2) for j in range(N*6+2): if ZIRO[j]>0: NZIRO[j+1] += ZIRO[j]/6 NZIRO[j+2] += ZIRO[j]/6 NZIRO[j+3] += ZIRO[j]/6 NZIRO[j+4] += ZIRO[j]/6 NZIRO[j+5] += ZIRO[j]/6 NZIRO[j+6] += ZIRO[j]/6 ZIRO = NZIRO ZIROAC = list(itertools.accumulate(ZIRO)) ans = 0 for i in range(N*6+2): ans += TARO[i]*(ZIROAC[i-1]) print(ans)