n = int(input()) k = int(input()) max_sum = 6 * n # Calculate Jiro's probability distribution (normal dice) jiro_dp = [0.0] * (max_sum + 1) jiro_dp[0] = 1.0 for _ in range(n): next_dp = [0.0] * (max_sum + 1) for s in range(max_sum + 1): if jiro_dp[s] == 0: continue prob = jiro_dp[s] / 6 for d in range(1, 7): next_sum = s + d if next_sum > max_sum: continue next_dp[next_sum] += prob jiro_dp = next_dp # Calculate Taro's probability distribution (K loaded and N-K normal dice) taro_dp = [0.0] * (max_sum + 1) taro_dp[0] = 1.0 # Process K loaded dice for _ in range(k): next_taro = [0.0] * (max_sum + 1) for s in range(max_sum + 1): if taro_dp[s] == 0: continue prob = taro_dp[s] / 3 for d in [4, 5, 6]: next_sum = s + d if next_sum > max_sum: continue next_taro[next_sum] += prob taro_dp = next_taro # Process N-K normal dice for _ in range(n - k): next_taro = [0.0] * (max_sum + 1) for s in range(max_sum + 1): if taro_dp[s] == 0: continue prob = taro_dp[s] / 6 for d in range(1, 7): next_sum = s + d if next_sum > max_sum: continue next_taro[next_sum] += prob taro_dp = next_taro # Calculate the total winning probability total = 0.0 for s in range(max_sum + 1): prob_taro = taro_dp[s] if prob_taro == 0: continue # Sum of Jiro's probabilities where his sum is less than s prob_jiro_less = sum(jiro_dp[:s]) total += prob_taro * prob_jiro_less # Print the result with five decimal places print("{0:.5f}".format(total))