#include using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o<> 7); seed = seed ^ (seed << 17); return (seed >> 33); } const int B = 1<<18; const int SZ = 1<<13; vector v[B]; int sum[B]; 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(); int bid = a[i]/SZ; v[bid].pb(a[i]); ++sum[bid]; } rep(i,B-1) sum[i+1] += sum[i]; ll sm = 0; for (int i = 0; i < q; i++) { int x = next(); int bid = x/SZ; int cnt = 0; if(bid>0) cnt = sum[bid-1]; for(int j:v[bid]) cnt += (j