$P, $Q = gets.split(" ").map{|s| s.to_i} def lose?(n) n**2 > ($P + $Q * n * Math.log(n, 2)) end n = 1 while not lose?(n) do n *= 2 end lb = n / 2.0 ub = n.to_f while ub - lb >= 10**(-5) do mid = (lb + ub) / 2.0 if lose?(mid) then ub = mid else lb = mid end end puts lb