#include <iostream>
#include <vector>
#include <algorithm>
#include <utility> using namespace std; typedef pair<int,int> Point; int n,m; void clockwise_rotate(Point &cell, int x){
for(int i = ; i < x; ++ i){
int tmp = cell.first;
cell.first = cell.second;
cell.second = n-tmp + ;
swap(n,m);
}
} void horizontal_rotate(Point &cell, int y){
if(y==) cell.second = m - cell.second +;
} int main(){
int x,y,z,p;
cin >> n >> m >> x >> y >> z >> p;
x %=; y %=; z %= ;
int tmp_n = n,tmp_m = m;
for(int i = ; i < p; ++ i){
n = tmp_n; m =tmp_m;
int cellX,cellY;
cin >> cellX >> cellY;
Point cell = make_pair(cellX,cellY);
clockwise_rotate(cell,x);
horizontal_rotate(cell,y);
clockwise_rotate(cell,-z);
cout<<cell.first<<" "<<cell.second<<endl;
}
return ;
}

codeforces round #234B(DIV2) C Inna and Huge Candy Matrix的更多相关文章

  1. codeforces round #234B(DIV2) A Inna and Choose Options

    #include <iostream> #include <string> #include <vector> using namespace std; ; ,,, ...

  2. codeforces round #234B(DIV2) B Inna and New Matrix of Candies

    #include <iostream> #include <vector> #include <string> #include <algorithm> ...

  3. codeforces C. Inna and Huge Candy Matrix

    http://codeforces.com/problemset/problem/400/C 题意:给你一个n*m的矩阵,然后在矩阵中有p个糖果,给你每个糖果的初始位置,然后经过x次顺时针反转,y次旋 ...

  4. codeforces C. Inna and Huge Candy Matrix 解题报告

    题目链接:http://codeforces.com/problemset/problem/400/C 题目意思:给出一个n行m列的矩阵,问经过 x 次clockwise,y 次 horizontal ...

  5. codeforces 400 C Inna and Huge Candy Matrix【模拟】

    题意:给出一个矩形的三种操作,顺时针旋转,逆时针旋转,对称,给出原始坐标,再给出操作数,问最后得到的坐标 画一下模拟一下操作就可以找到规律了 #include<iostream> #inc ...

  6. Codeforces Round #539 div2

    Codeforces Round #539 div2 abstract I 离散化三连 sort(pos.begin(), pos.end()); pos.erase(unique(pos.begin ...

  7. 【前行】◇第3站◇ Codeforces Round #512 Div2

    [第3站]Codeforces Round #512 Div2 第三题莫名卡半天……一堆细节没处理,改一个发现还有一个……然后就炸了,罚了一啪啦时间 Rating又掉了……但是没什么,比上一次好多了: ...

  8. Codeforces Round#320 Div2 解题报告

    Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Fin ...

  9. Codeforces Round #564(div2)

    Codeforces Round #564(div2) 本来以为是送分场,结果成了送命场. 菜是原罪 A SB题,上来读不懂题就交WA了一发,代码就不粘了 B 简单构造 很明显,\(n*n\)的矩阵可 ...

随机推荐

  1. 设置tomcat内存设定

    Linux: 在/usr/local/apache-tomcat-/bin 目录下的catalina.sh添加: JAVA_OPTS='-Xms512m -Xmx1024m'要加"m&quo ...

  2. location url 反向代理到来机的其它端口 gitlab

    location /nexus { proxy_pass http://127.0.0.1:8081/nexus; } [root@GitMaven conf]# pwd /var/opt/gitla ...

  3. jquery学习笔记----ajax使用

    一.load() 加载页面数据 load(url,[data],[callback]) url:加载的页面地址,[data]传送的数据,[callback]加载完成时回调函数. 设计一个load.ht ...

  4. Weblogic监控指标

    http://blog.csdn.net/a_dreaming_fish/article/details/50592042

  5. Kl 证明 凸函数

    回到随机变量传输问题,假设传输中我们不知道具体 分布情况(unknown),我们用一个已知的分布 ,来模拟它,那么在这种情况下如果我们利用 尽可能高效的编码,那么我们平均需要多少额外的信息量来描述x呢 ...

  6. 在ubuntu上搭建开发环境8---Ubuntu搭建Android开发环境

    需要首先配置好JDK环境 参看:http://www.cnblogs.com/xumenger/p/4460055.html 安装Eclipse 在Android developer的官网上直接下载a ...

  7. Linux/centos下安装riak

    必备的组件: gccgcc-c++glibc-develmakepam-devel 使用yum安装相关组件 sudo yum install gcc gcc-c++ glibc-devel make ...

  8. hdu 5033 单调栈 ****

    看出来是单调栈维护斜率,但是不会写,2333,原来是和询问放在一起的 #include <iostream> #include <cstdio> #include <cs ...

  9. DTMF的原理分析

    转自:http://blog.csdn.net/wangwenwen/article/details/8264925 1. DTMF原理 DTMF(Double Tone MulitiFrequenc ...

  10. 汇编学习(二)——8086CPU

    一.8086CPU 1.微处理器 (1)微控制机:也称单片机 (2)DSP芯片:数字信号处理芯片 (3)嵌入式微处理器 (4)通用微处理器:PC站.工作站.服务器使用的处理器 2.内部结构: (1)总 ...