import random N = int(input()) K = int(input()) S = 0 T = 7 ** 7 for _ in range(T): A = 0 for i in range(N): A += random.randrange(1,7) - random.randrange(4 if i < K else 1, 7) S += A < 0 print(S / T)