#include<bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i ++)
#define LL long long
#define mx 105
using namespace std;

const LL mod = 1000000007;

int c[mx], b[mx], n, bb, B[mx];
int st, en;

LL res[300], dp[mx][mx * mx];
LL add[mx * mx];

void Add(LL &x, LL y){
	x = (x + y + mod) % mod;
}

void calc(int x){
	memset(dp, 0, sizeof dp);
	rep(i, max(x, 0), c[1] + 1) dp[1][i] = 1;
	int lim = x;
	rep(i, 2, n + 1) {
		lim += x + b[i - 1];
		memset(add, 0, sizeof add);
		rep(j, 0, 10001) if(dp[i - 1][j] && j + c[i] >= lim){
			Add(add[j + max(lim - j, 0)], dp[i - 1][j]);
			Add(add[j + c[i] + 1], -dp[i - 1][j]);
		}
		rep(j, 0, 10001){
			j ? dp[i][j] = (dp[i][j - 1] + add[j]) % mod : dp[i][j] = add[j];
		}
	}
	rep(j, 0, 10001) Add(res[x - st], dp[n][j]);
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
	
	cin >> n;
	rep(i, 1, n + 1) cin >> c[i];
	rep(i, 1, n) {
		cin >> bb;
		b[i] = b[i - 1] + bb;
		B[i] = B[i - 1] + b[i];
	}
	st = -B[n - 1] / n - 2;
	en = 100 + st + 5;
	rep(x, st, en + 1) calc(x);
	int q, X;
	cin >> q;
	while(q --){
		cin >> X;
		if(X < st) cout << res[0] << endl;
		else if(X <= en) cout << res[X - st] << endl;
		else cout << 0 << endl;
	}
	
	return 0;
}
