#include #include #include using namespace std; // #include // using namespace atcoder; // using mint = modint998244353; using ll = long long; #define fix(x) fixed << setprecision(x) #define rep(i, n) for(int i = 0; i < n; ++i) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> h >> w; auto ans = [&](int i, int j) -> void { cout << "! " << i << " " << j << endl; exit(0); }; auto query = [&](int i, int j) -> int { cout << "? " << i << " " << j << endl; int res; cin >> res; assert(res>=0); if(res==0) ans(i,j); return res; }; if(h==1&&w==1) ans(1,1); int x = query(1,1); if(h==1 || w==1){ if(h==1) ans(1, 1 + sqrt_int(x)); else ans(1 + sqrt_int(x), 1); } int y = query(1,2); for(int i=1;i<=h;++i)for(int j=1;j<=w;++j){ if((i-1)*(i-1)+(j-1)*(j-1)==x && (i-1)*(i-1)+(j-2)*(j-2)==y){ ans(i,j); } } sleep(998244353); return 0; }