import random def win(n, k): n -= k sum = 0 for i in range(k): sum += random.randint(4, 6)-random.randint(1, 6) for i in range(n): sum += random.randint(1, 6)-random.randint(1, 6) return sum>0 n = int(input()) k = int(input()) trying = 100000 cnt = 0 for i in range(trying): if(win(n, k)): cnt += 1 print(cnt/trying)