T = gets.to_i def send_query(y) STDOUT.puts("? %.12f" % y) STDOUT.flush res = gets.chomp res == "Yes" end T.times do ok = 0.000001 ng = 12.22 * 10 ** 74 + 1.0 24.times do y = Math.sqrt(ok * ng) if send_query(y) ok = y else ng = y end end STDOUT.puts("! %.12f" % Rational(2 * ok * ng, ok + ng)) STDOUT.flush end