$|=1; $a=1; $b=1e9; while($a<$b){ $c=$a+$b+1>>1; print"? ",$c,$/; $r=<>; $r>0 ? ($a=$c) : ($b=$c-1); } print"! $a\n";