#include #include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template vector> vec2d(int n, int m, T v){ return vector>(n, vector(m, v)); } template vector>> vec3d(int n, int m, int k, T v){ return vector>>(n, vector>(m, vector(k, v))); } template void print_vector(vector v, char delimiter=' '){ if(v.empty()) { cout << endl; return; } for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter; cout << v.back() << endl; } using P = pair; void test(){ for(int x = 1; x <= 100; x++){ set st; for(int a = 0; a <= 99; a++){ int b = a+1; int r0 = (a+x)%b; st.insert(r0); } debug_value(st.size()) if(st.size() == 100){ cout << x << ' ' << endl; return; } } debug_value("DONE") } void test0(){ int mx = 0; for(int x = 1; x <= 100; x++){ for(int y = x+1; y <= 100; y++){ set

st; for(int a = 0; a <= 99; a++){ for(int b = a+1; b <= 100; b++){ int r0 = (a+x)%b; int r1 = (a+y)%b; st.insert({r0, r1}); } } chmax(mx, st.size()); // debug(st.size()) if(st.size() == 5050){ cout << x << ' ' << y << endl; return; } } } debug_value(mx) debug_value("DONE") } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; auto f = [&](int x){ cout << "? " << x << endl; int ans; cin >> ans; return ans; }; int a0 = f(100); if(a0 == 99){ cout << "! " << 99 << ' ' << 100 << endl; return 0; } int B = f(100-a0-1)+1; int A = (a0-100)%B; A += B; A %= B; cout << "! " << A << ' ' << B << endl; }