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 ng = 76.0 24.times do e = (ok + ng) / 2.0 y = 10 ** e - 1.0 if send_query(y) ok = e else ng = e end end STDOUT.puts("! %.12f" % (10 ** ok - 1.0)) STDOUT.flush end