#include void solve() { int ok = 1, ng = 1000000001; while (ng - ok > 1) { int mid = (ok + ng) / 2; std::cout << "? " << mid << std::endl; int c; std::cin >> c; if (c) { ok = mid; } else { ng = mid; } } std::cout << "! " << ok << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }