题目链接
- 202309-1 坐标变换(其一)
题目描述
求解思路
- 直接暴力模拟即可。
实现代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n, m;
n = in.nextInt();
m = in.nextInt();
int[] x = new int[m];
int[] y = new int[m];
int dx = 0, dy = 0;
for (int i = 0; i < n; i ++) {
dx += in.nextInt();
dy += in.nextInt();
}
for (int i = 0; i < m; i ++) {
x[i] = in.nextInt();
y[i] = in.nextInt();
x[i] += dx;
y[i] += dy;
System.out.println(x[i] + " " + y[i]);
}
}
}