// #define _GLIBCXX_DEBUG #include using namespace std; #include using namespace atcoder; using ll = long long; #define rep(i,n) for (ll i = 0; i < (n); ++i) using vl = vector; using vvl = vector; using P = pair; #define pb push_back #define int long long #define double long double #define INF (ll) 3e18 // Ctrl + Shift + B コンパイル // Ctrl + C 中断 // ./m 実行 signed main(){ int a = -1; int b = -1; int x1 = 100; int x2 = -1; int y1 = -1; int y2 = -1; cout << "? " << x1 << endl; cin >> y1; x2 = x1 - y1-1; cout << "? " << x2 << endl; cin >> y2; b = y2 + 1; a = b-1 - (x2 % b); cout << "! " << a << " " << b << endl; } // (A + x) % B = y // (A + x) % B = y // A = 13 B = 97 // x1 = 1000 // 1013 % 97 = 43 // x2 = 956 // (956+13) % 97 = 96 // a = b-1 - x2%b