#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll maxn=205;
const ll cn0=0;
const ll mod=1e9+7;
ll b[maxn],c[maxn],bp[maxn],bpp[maxn],cp[maxn],dp[2][maxn*maxn],ans[maxn<<1];
int n;
int main(){
	cin>>n;bp[0]=bpp[0]=cp[0]=0; 
	for(int i=1;i<=n;i++){scanf("%lld",&c[i]);cp[i]=c[i]+cp[i-1];}
	for(int i=1;i<n;i++){scanf("%lld",&b[i]);bp[i]=bp[i-1]+b[i];bpp[i]=bpp[i-1]+bp[i];}
	ll mn=1<<30;
	for(int i=1;i<=n;i++)mn=min(mn,-bpp[i-1]/i);ll mx=mn+150;mn=mn-45;
	memset(ans,-1,sizeof(ans));
	int q;cin>>q;ll x;
	while(q--){
		scanf("%lld",&x);
		x=min(mx,max(mn,x));
		if(~ans[x-mn]){
			printf("%lld\n",ans[x-mn]);
			continue;
		}
		memset(dp,0,sizeof(dp));
		int cur,nxt;cur=1;nxt=0;
		for(int i=0;i<=c[1];i++)dp[cur][i]=1;
		for(ll i=1;i<=n;i++){
			memset(dp[nxt],0,sizeof(dp[nxt]));
			for(ll j=max(cn0,x*i+bpp[i-1]);j<=cp[i];j++){
				dp[nxt][j]=(dp[cur][min(j,cp[i-1])]+dp[nxt][j])%mod;
				if(j>c[i])dp[nxt][j]=(dp[nxt][j]-dp[cur][j-c[i]-1]+mod)%mod;
			}
			for(int j=1;j<=cp[i];j++)dp[nxt][j]=(dp[nxt][j]+dp[nxt][j-1])%mod;
			swap(cur,nxt);
		}
		ans[x-mn]=dp[cur][cp[n]];
		printf("%lld\n",ans[x-mn]);
	}
}
