#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "assert.h" using namespace std; //[n*p] * [p*m] => [n*m] template vector< vector > multmat(const vector > &A, const vector> &B, int n, int p, int m){ vector > C(n, vector(m,0)); for(int i=0; i> m; vector px(m), py(m); for(int i=0; i> px[i] >> py[i]; } cout << "? " << 0 << " " << 0 << endl; long long ax,ay; cin >> ax >> ay; cout << "? " << 1 << " " << 0 << endl; long long bx,by; cin >> bx >> by; long long dx = bx-ax; long long dy = by-ay; int rot; if(dx == 1){ rot = 0; }else if(dx == -1){ rot = 180; }else if(dy == 1){ rot = 90; }else if(dy == -1){ rot = 270; } cerr << rot << endl; double PI = acos(-1.0); vector> A = { {round(cos(rot*PI/180.0)), round(-sin(rot*PI/180.0)), ax}, {round(sin(rot*PI/180.0)), round(cos(rot*PI/180.0)), ay}, {0,0,1} }; cout << "!" << endl; for(int i=0; i> v = { {px[i]}, {py[i]}, {1} }; auto ans = multmat(A, v, 3,3,1); cout << ans[0][0] << " " << ans[1][0] << endl; } return 0; }