#include int main() { int top = 1, tail = 1e9, b; while (1) { printf("? %d\n", (top + tail) / 2); fflush(stdout); scanf("%d", &b); if (b) top = (top + tail) / 2; else tail = (top + tail) / 2; if (top == tail - 1) break; } printf("! %d\n", top); return 0; }