#include using namespace std; int main() { int N; cin >> N; cout << "? " << N/2 << endl; int S; cin >> S; if(S == 0) { cout << "! " << 1 << " " << N/2 << endl; return 0; } if(S == N/2) { cout << "! " << 2 << " " << N-1 << endl; return 0; } int l = N/2,r = N+1; while (l < r) { int mid = (l+r)/2; cout << "? " << mid << endl; int a; cin >> a; if(a == 0) { cout << "! " << 1 << " " << mid << endl; return 0; } if(a < 0 && S > 0) { r = mid; continue; } if(a > 0 && S < 0) { r = mid; continue; } if(N-mid == abs(a)) { r = mid; continue; } l = mid; } cout << "! " << 1 << " " << r << endl; }