p0, q = map(int, input().split()) # Initialize f with 0.5 for all p f = [0.5] * 101 threshold = 1e-9 while True: new_f = [0.0] * 101 max_change = 0.0 for p in range(101): p_used = max(0, p - q) p_not_used = min(100, p + q) # Calculate w and d w = (1 - p / 100) / 3 d = (2 + p / 100) / 6 # Probability terms prob_method_used = p / 100 prob_method_not_used = (100 - p) / 100 # Compute the term involving f[p_used] and f[p_not_used] term = d * (prob_method_used * f[p_used] + prob_method_not_used * f[p_not_used]) new_f_p = w + term new_f[p] = new_f_p # Update maximum change change = abs(new_f_p - f[p]) if change > max_change: max_change = change # Check for convergence if max_change < threshold: break # Update f for next iteration f = new_f # Calculate the total probability p_total = 1/3 + (1/3) * f[p0] # Output with sufficient precision print("{0:.10f}".format(p_total))