#include #include using namespace std; using ll = long long; using ull = unsigned long long; ull seed; int next() { seed = seed ^ (seed << 13); seed = seed ^ (seed >> 7); seed = seed ^ (seed << 17); return (seed >> 33); } int main() { int n, q; cin >> n >> q >> seed; for (int i = 0; i < 10000; i++) next(); vector a(n); for (int i = 0; i < n; i++) a[i] = next(); ll sm = 0; for (int i = 0; i < q; i++) { int x = next(); int cnt = 0; for (int j = 0; j < n; j++) { if (a[j] < x) cnt++; } sm ^= ll(cnt) * i; } cout << sm << endl; return 0; }