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