def candidate(p, q, d) ts = [] (0..100).each do |y| (0..100).each do |x| if ((p - x) ** 2 + (q - y) ** 2) == d then ts.push([x, y]) end end end return ts end def intersection(s, t) u = [] s.each do |x| u.push(x) if t.include?(x) end return u end def main(argv) p = 0 q = 0 puts "? #{p} #{q}" STDOUT.flush d = gets.chomp.to_i ts = candidate(p, q, d) p = 100 q = 0 puts "? #{p} #{q}" STDOUT.flush d = gets.chomp.to_i ts = candidate(p, q, d) p = ts[0][0] q = ts[0][1] puts "! #{p} #{q}" STDOUT.flush end main(ARGV) if self.to_s == 'main'