#include using namespace std; long maximumPeople(vector p, vector x, vector y, vector r) { long n=p.size(); long m=y.size(); long totalmax=0; for(long i=0;i=(y[i]-r[i])&&(x[j]<=(y[i]+r[i]))) { maxpop=maxpop+p[j]; } } if(maxpop>totalmax) totalmax=maxpop; } long sunny=0; for(long i=0;i=(y[j]-r[j])&&(x[i]<=(y[j]+r[j]))) temp=1; } if(temp==0) sunny=+p[i]; } return(sunny+totalmax); } int main() { int n; cin >> n; vector p(n); for(int p_i = 0; p_i < n; p_i++){ cin >> p[p_i]; } vector x(n); for(int x_i = 0; x_i < n; x_i++){ cin >> x[x_i]; } int m; cin >> m; vector y(m); for(int y_i = 0; y_i < m; y_i++){ cin >> y[y_i]; } vector r(m); for(int r_i = 0; r_i < m; r_i++){ cin >> r[r_i]; } long result = maximumPeople(p, x, y, r); cout << result << endl; return 0; }