#include using namespace std; int main() { int d1, d2; cout << "? 0 0" << endl; cin >> d1; typedef pair P; vector

v; for( int i = 0; i <= 100; i++ ) { for( int j = 0; j <= 100; j++ ) { if( i * i + j * j == d1 ) { v.push_back( P( i, j ) ); } } } cout << "? 0 100" << endl; cin >> d2; int N = v.size(); for( int i = 0; i < N; i++ ) { int x, y; tie( x, y ) = v[i]; int yy = y - 100; if( x * x + yy * yy == d2 ) { cout << "! " << x << " " << y << endl; return 0; } } }