#define _USE_MATH_DEFINES #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// const int nmax = 100000; bool A[nmax+1]; bool B[nmax+1]; int ans[nmax+1]; int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// int Amax,Bmax,N; cin>>Amax>>Bmax>>N; int temp; rep(i,Amax){ cin>>temp; A[temp] = true; } rep(i,Bmax){ cin>>temp; B[temp] = true; } int Q; cin>>Q; rep(i,Q){ for(int j=1;j+i<=nmax;++j){ if(B[j] && A[j+i] ){ ++ans[i]; } } } rep(i,Q){ P(ans[i]); } return 0; }