#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
const long long mod = 1e9 + 7;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> mx(n + 1);
  for (int i = 1; i <= n; i++) cin >> mx[i];
  vector<int> b(n + 1);
  for (int i = 1; i < n; i++) cin >> b[i], b[i] += b[i - 1];
  for (int i = 1; i < n; i++) b[i] += b[i - 1];
  vector<vector<long long> > dp(n + 1, vector<long long>(10010, 0));
  vector<long long> ans(300);
  int mn = 100000;
  for (int i = 1; i < n; i++) mn = min(mn, -b[i] / i - 1);
  for (int x = mn; x <= mn + 101; x++) {
    dp[0][0] = 1;
    int suma = 0;
    for (int i = 1; i <= n; i++) {
      fill((dp[i]).begin(), (dp[i]).end(), 0);
      for (int val = 0; val <= mx[i]; val++) {
        int mn = b[i - 1] + x * i - val;
        mn = max(mn, 0);
        for (int bf = mn; bf <= suma; bf++) {
          dp[i][val + bf] += dp[i - 1][bf];
          if (dp[i][val + bf] >= mod) dp[i][val + bf] -= mod;
        }
      }
      suma += mx[i];
    }
    ans[x - mn + 1] = 0;
    for (int i = 0; i <= suma; i++) {
      ans[x - mn + 1] += dp[n][i];
      if (ans[x - mn + 1] >= mod) ans[x - mn + 1] -= mod;
    }
  }
  int tt;
  cin >> tt;
  while (tt--) {
    int x;
    cin >> x;
    x = max(x, mn);
    x = min(x, mn + 101);
    cout << ans[x - mn + 1] << '\n';
  }
}
