#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ int low = 1, hi = 1 << 30, mid = (low + hi) / 2, q = -1, pq = -1; cout << "? " << mid << endl; while (1){ cin >> q; if (q == 0 && pq == 1 && (mid - low) == 1) break; else { if (q == 1) low = mid; else hi = mid; mid = (low + hi)/ 2; pq = q; cout << "? " << mid << endl; } } cout << "! " << low << endl; }