#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 using P = pair; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int N,M; cin>>N>>M; vector

i0(N),i1(M); rep(i,N){ cin>>i0[i].first>>i0[i].second; rep(j,4){ i0[i].first -= Inf32; i0[i].second -= Inf32; } i0[i].first *= 2; i0[i].second *= 2; } rep(i,M){ cin>>i1[i].first>>i1[i].second; rep(j,4){ i1[i].first += Inf32; i1[i].second += Inf32; } i1[i].first *= 2; i1[i].second *= 2; } sort(i0.begin(),i0.end()); sort(i1.begin(),i1.end()); int K; cin>>K; vector p(K); rep(i,K){ cin>>p[i]; p[i] *= 2; } rep(i,i0.size()){ if(i>=1 && i0[i].first <= i0[i-1].second){ rep(j,K){ if(j!=0)cout<<' '; cout<<1; } cout<=1 && i1[i].first <= i1[i-1].second){ rep(j,K){ if(j!=0)cout<<' '; cout<<1; } cout< ans(K+1); rep(i,N){ rep(j,M){ long long A = (i0[i].first + i1[j].first)/2; long long B = (i0[i].second + i1[j].second)/2; if(A>B)swap(A,B); int d; d = distance(p.begin(),lower_bound(p.begin(),p.end(),A)); ans[d]++; d = distance(p.begin(),upper_bound(p.begin(),p.end(),B)); ans[d]--; } } rep(i,K){ ans[i+1] += ans[i]; if(i!=0)cout<<' '; if(ans[i]>0)cout<<1; else cout<<0; } cout<