#P16054. [CSPro 31] 坐标变换(其一)
[CSPro 31] 坐标变换(其一)
Background
Luogu’s testdata is only for community communication and is not official testdata. Official judging link: https://www.cspro.org/.
Problem Description
For a point on the Cartesian plane, Little P defines a sequence consisting of operations. Each operation () has two parameters and , meaning translating the point to .
Now given initial points, compute the final coordinates after applying the operations in in order to each point ().
Input Format
Read input from standard input.
There are lines in total.
The first line contains two positive integers and separated by spaces, representing the number of operations and the number of initial points.
The next lines describe the operations in order. Line () contains two integers and separated by spaces.
The next lines describe the points in order. Line () contains two integers and separated by spaces.
Output Format
Output to standard output.
Output lines. Line () contains two integers separated by spaces, representing the position of the initial point after the operations.
3 2
10 10
0 0
10 -20
1 -1
0 0
21 -11
20 -10
Hint
Sample Explanation
After three operations, the first point becomes ; the second point becomes .
Subtasks
All testdata satisfies: , and all input values are integers with absolute values not exceeding .
Translated by ChatGPT 5