CF400C 题解
I_like_magic · · 题解
这道题其实不难,只是一道非常简单的模拟题。
我们发现,每顺时针转动
所以,在操作前,我们可以让
接下来,只需在草稿纸上画一画,即可知道顺时针转一次,一个点的
This problem is not difficult, it's just a very simple simulation problem.
We found that every
So, before proceeding, we can set
Next, just draw a picture on the draft paper to know that if you turn it clockwise once, the
AC Code:
#include<bits/stdc++.h>
using namespace std;
int n,m,x,y,z,p;
struct e{
int x,y;
}d[100005];
void fun1(int t){
while(t--){
for(int i=1;i<=p;i++){
int o=d[i].x;
d[i].x=d[i].y;
d[i].y=n-o+1;
}
swap(n,m); //记得交换
}
}
void fun2(int t){
while(t--){
for(int i=1;i<=p;i++){
d[i].y=m-d[i].y+1;
}
}
}
void fun3(int t){
while(t--){
for(int i=1;i<=p;i++){
int o=d[i].y;
d[i].y=d[i].x;
d[i].x=m-o+1;
}
swap(n,m);
}
}
int main(){
cin>>n>>m>>x>>y>>z>>p;
x%=4;y%=2;z%=4; //记得模一下
for(int i=1;i<=p;i++)cin>>d[i].x>>d[i].y;
fun1(x);fun2(y);fun3(z);
for(int i=1;i<=p;i++)cout<<d[i].x<<" "<<d[i].y<<"\n";
return 0;
}