#include <iostream>
#include <vector>
#include <limits>
#include <cmath>
#include <algorithm>
using namespace std;
#pragma warning (disable: 4996)

template<typename Type> class RangeAddMinSegmentTree {
private:
	unsigned size_; std::vector<Type> dat1, dat2;
	inline void update_(unsigned a, unsigned b, Type x, unsigned k, unsigned l, unsigned r) {
		if (r <= a || b <= l) return;
		if (a <= l && r <= b) {
			dat2[k] += x; return;
		}
		update_(a, b, x, (k << 1), l, (l + r) >> 1);
		update_(a, b, x, (k << 1) + 1, (l + r) >> 1, r);
		dat1[k] = std::min(dat1[k << 1] + dat2[k << 1], dat1[(k << 1) + 1] + dat2[(k << 1) + 1]);
	}
	inline Type query_(unsigned a, unsigned b, unsigned k, unsigned l, unsigned r) {
		if (r <= a || b <= l) return std::numeric_limits<Type>::max();
		if (a <= l && r <= b) return dat1[k] + dat2[k];
		Type lc = query_(a, b, (k << 1), l, (l + r) >> 1);
		Type rc = query_(a, b, (k << 1) + 1, (l + r) >> 1, r);
		return std::min(lc, rc) + dat2[k];
	}
public:
	RangeAddMinSegmentTree() : size_(0), dat1(std::vector<Type>()), dat2(std::vector<Type>()) {};
	RangeAddMinSegmentTree(int size__) {
		for (size_ = 1; size_ < size__; ) size_ <<= 1;
		dat1.resize(size_ << 1, 0);
		dat2.resize(size_ << 1, 0);
	}
	inline unsigned size() { return size_; }
	inline void add(unsigned i, Type x) {
		update_(i, i + 1, x, 1, 0, size_);
	}
	inline void add(unsigned l, unsigned r, Type x) {
		update_(l, r, x, 1, 0, size_);
	}
	inline Type query(unsigned l, unsigned r) {
		return query_(l, r, 1, 0, size_);
	}
};

const int MAX_N = 1100000;

long long N, A[1 << 18], S[1 << 18];
long long Q, V[1 << 18];
long long dp[1 << 18];
RangeAddMinSegmentTree<long long> X;

long long vec[1 << 18];
long long ret[1 << 22];

int main() {
	// ステップ 1: 入力
	scanf("%lld", &N); for (int i = 1; i <= N - 1; i++) scanf("%lld", &A[i]);
	scanf("%lld", &Q); for (int i = 1; i <= Q; i++) scanf("%lld", &V[i]);

	// ステップ 2: 初期値 [0] を求める
	S[0] = 0; A[N] = 0;
	for (int i = 1; i <= N; i++) S[i] = S[i - 1] + A[i];
	X = RangeAddMinSegmentTree<long long>(N + 1);
	dp[N - 1] = A[N - 1] - A[N]; X.add(N - 1, N, dp[N - 1]);
	for (int i = N - 2; i >= 1; i--) {
		long long V1 = X.query(i + 1, N);
		dp[i] = -V1 + A[i];
		X.add(i, i + 1, dp[i]);
		X.add(i + 1, N, A[i]);
	}

	// ステップ 3: 反射位置を記録する
	long long cur = dp[N - 1] + S[N - 2];
	int cnt = 0;
	for (int i = N - 2; i >= 1; i--) {
		long long val = dp[i] + S[i - 1];
		vec[cnt] = cur + val; if (i != 1) cnt++;
		cur = min(cur, dp[i] + S[i - 1]);
	}
	sort(vec, vec + cnt);

	// ステップ 4. 反射する
	for (int i = -MAX_N; i <= 2 * MAX_N; i++) {
		int val = i;
		int pos1 = lower_bound(vec, vec + cnt, val * 2) - vec; pos1--;
		if (pos1 < 0) ret[i + MAX_N] = val;
		else {
			int r = vec[pos1] - val;
			if (r < 0) ret[i + MAX_N] = r;
			else ret[i + MAX_N] = ret[r + MAX_N];
		}
	}

	// ステップ 5: 答えを求める
	for (int i = 1; i <= Q; i++) {
		long long v = dp[N - 1] + S[N - 2] - V[i], ans = 0;
		if (v <= -MAX_N) ans = ret[0] + (ret[0] - ret[1]) * abs(v - (-MAX_N));
		else if (v >= 2 * MAX_N) ans = ret[3 * MAX_N] + (ret[3 * MAX_N] - ret[3 * MAX_N - 1]) * abs(v - (2 * MAX_N));
		else ans = ret[v + MAX_N];
		printf("%lld\n", vec[cnt] - ans);
	}
	return 0;
}

Measured memory_bytes: 47232