#region Header #!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools from queue import PriorityQueue import bisect import heapq def input(): return sys.stdin.readline()[:-1] sys.setrecursionlimit(1000000) #endregion # _INPUT = """# paste here... # """ # sys.stdin = io.StringIO(_INPUT) def main(): N = int(input()) K = int(input()) dp1 = [[0 for _ in range(6*N+1)] for _ in range(N+1)] dp1[0][0] = 1 for n in range(1, N+1): for k in range(1, 6*N+1): dp1[n][k] = sum(dp1[n-1][max(k-6,0):k]) / 6 dp2 = [[0 for _ in range(6*N+1)] for _ in range(N+1)] dp2[0][0] = 1 for n in range(1, K+1): for k in range(1, 6*N+1): dp2[n][k] = sum(dp2[n-1][max(k-6,0):max(k-3,0)]) / 3 for n in range(K+1, N+1): for k in range(1, 6*N+1): dp2[n][k] = sum(dp2[n-1][max(k-6,0):k]) / 6 p = 0 for k1 in range(1, 6*N+1): for k2 in range(k1+1, 6*N+1): p += dp1[N][k1] * dp2[N][k2] print(p) if __name__ == '__main__': main()