package main import "fmt" func main() { solve() } func ask(x int) int { fmt.Println("?", x) var y int fmt.Scan(&y) return y } func solve() { lb := -1 ub := 1000000000 if ask(100)==-1{ ub = 100 } for i := 1; i < 100; i++ { mid := (lb + ub) / 2 ans := ask(mid-1) if ans == -1 { ub = mid } if ans == 1 { lb = mid } if ans == 0 { fmt.Println("!", mid+i-1) break } } }