#include using namespace std; int main() { int n; cin >> n; int s0, s1; cout << "? " << 1 << endl; cin >> s0; cout << "? " << n - 1 << endl; cin >> s1; if(s0 != n / 2 - s1){ cout << "! " << 2 << " " << n - 1 << endl; return 0; } int right = n, left = 0; bool f = s0; while(right - left > 1){ int mid = (right + left) / 2; cout << "? " << mid << endl; int s; cin >> s; if(s * 2 == mid){ if(mid * 2 > n) cout << "! " << 1 << " " << mid << endl; else cout << "! " << mid + 1 << " " << n << endl; return 0; } if((s * 2 > mid) == f) left = mid; else right = mid; } }