链接和思路
OJ链接:传送门
从问题描述看,本题没有任何难点,仅需要理解 n n n次操作是可累计的,仅需做1次坐标变换。
AC代码
#include <iostream>
using namespace std;
int n, m;
int dx = 0, dy = 0;
int main() {
cin >> n >> m;
for (int i = 0; i < n; ++i) {
int x, y;
cin >> x >> y;
dx += x;
dy += y;
}
for (int i = 0; i < m; ++i) {
int x, y;
cin >> x >> y;
cout << x + dx << " " << dy + y << endl;
}
return 0;
}