-
Notifications
You must be signed in to change notification settings - Fork 86
/
1208A. Xorinacci.cpp
57 lines (42 loc) · 976 Bytes
/
1208A. Xorinacci.cpp
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
47
48
49
50
51
52
53
54
55
56
57
/***from dust i have come, dust i will be***/
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define dbg printf("in\n")
#define nl printf("\n")
#define N 35
#define inf 1e18
#define mod 100000007
#define sf(n) scanf("%d", &n)
#define sff(n,m) scanf("%d%d",&n,&m)
#define sfl(n) scanf("%I64d", &n)
#define sffl(n,m) scanf("%I64d%I64d",&n,&m)
#define pf(n) printf("%d",n)
#define pff(n,m) printf("%d %d",n,m)
#define pffl(n,m) printf("%I64d %I64d",n,m)
#define pfl(n) printf("%I64d",n)
#define pfs(s) printf("%s",s)
#define pb push_back
#define pp pair<int, int>
using namespace std;
int main()
{
freopen("in.txt", "r", stdin);
int i, j, k;
int n, m, q;
int a, b;
sf(q);
while(q--)
{
sff(a, b), sf(n);
m = a ^ b;
if((n + 1) % 3 == 1)
pf(a);
else if((n + 1) % 3 == 2)
pf(b);
else
pf(m);
nl;
}
return 0;
}