import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd, log from itertools import accumulate, permutations, combinations, product from operator import itemgetter, mul, add from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from bisect import bisect, bisect_left from heapq import heappush, heappop from functools import reduce, lru_cache import random def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) def ZIP(n): return zip(*(MAP() for _ in range(n))) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 N = INT() K = INT() s = [1, 2, 3, 4, 5, 6] s2 = [4, 5, 6] def simurate(player): if player == 0: score = 0 for i in range(N): score += random.choice(s) elif player == 1: score = 0 for i in range(N-K): score += random.choice(s) for i in range(K): score += random.choice(s2) return score cnt = 0 n = 10**6 for _ in range(n): if simurate(0) < simurate(1): cnt += 1 print(cnt/n)