forked from daiwb/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC.cpp
More file actions
46 lines (41 loc) · 936 Bytes
/
C.cpp
File metadata and controls
46 lines (41 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <memory>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
#define FOREACH(it,c) for(typeof((c).begin())it=(c).begin();it!=(c).end();++it)
#define CLR(x) memset((x),0,sizeof((x)))
typedef long long LL;
void run() {
LL n, idx;
cin >> n >> idx;
LL mx, my;
vector<LL> xx(n), yy(n);
cin >> mx >> my;
REP(i,n) cin >> xx[i] >> yy[i];
idx %= (n << 1);
REP(i,idx) {
int ii = (i % n);
mx = (xx[ii] << 1) - mx;
my = (yy[ii] << 1) - my;
}
cout << mx << " " << my << endl;
}
int main() {
run();
return 0;
}