#include #include #include using namespace std; unsigned long 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(); } long a[N]; for(int i = 0; i < N; i++){ a[i] = next(); } sort(a, a + N); long ans = 0; for(int i = 0; i < Q; i++) { int x = next(); ans ^= (lower_bound(a, a + N, x) - a) * i; } cout << ans << endl; }