/* -*- coding: utf-8 -*- * * 471.cc: No.471 直列回転機 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_M = 50000; /* typedef */ /* global variables */ int xs[MAX_M], ys[MAX_M]; /* subroutines */ void ask(int x, int y, int &xd, int &yd) { printf("? %d %d\n", x, y); fflush(stdout); scanf("%d%d", &xd, &yd); } /* main */ int main() { int m; scanf("%d", &m); for (int i = 0; i < m; i++) scanf("%d%d", xs + i, ys + i); // x' = ax + by + c // y' = dx + ey + f int a, b, c, d, e, f; // (0, 0) -> (c, f) ask(0, 0, c, f); // (1, 0) -> (a + c, d + f) int ac, df; ask(1, 0, ac, df); a = ac - c; d = df - f; // (0, 1) -> (b + c, e + f); int bc, ef; ask(0, 1, bc, ef); b = bc - c; e = ef - f; putchar('!'); putchar('\n'); for (int i = 0; i < m; i++) { int x = a * xs[i] + b * ys[i] + c; int y = d * xs[i] + e * ys[i] + f; printf("%d %d\n", x, y); } fflush(stdout); return 0; }