#P2129. L 国的战斗续之多路出击
L 国的战斗续之多路出击
Description
This time, Country L decides to divide its army into groups distributed across various locations. Taking Country L as the origin, these positions can be viewed in a Cartesian coordinate system. All groups are under unified command, and the command center issues commands. Commands include translation, up-down flip, and left-right flip. However, due to some odd latency, the army always receives commands with a delay. For convenience, a stack has already been prepared, so you must process the commands from back to front.
Input Format
The input consists of lines.
The first line contains two integers .
The next lines: on the -th line, two integers give the location of the -th army group.
The next lines each start with a character .
- If is
m, then two integers follow, meaning every group moves from to . - If is
x, then every group moves from to (left-right flip, i.e., reflection across the -axis). - If is
y, then every group moves from to (up-down flip, i.e., reflection across the -axis).
Output Format
Output lines. On the -th line, print two integers , the final position of the -th army group after all commands are applied (processed from last to first).
3 3
0 0
4 -3
6 7
x
m -1 2
y
1 2
-3 5
-5 -5
Hint
For of the testdata, .
For of the testdata, , and are within the int range.
Translated by ChatGPT 5
京公网安备 11011102002149号