#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <queue>
#include <deque>
#include <set>
#include <map>
#define int long long
#define ld long double

using namespace std;


void solve() {
	int n, m, t, ind;
	cin >> n >> m >> t;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	vector<bool> b(n);
	for (int i = 0; i < m; i++) {
		cin >> ind;
		ind--;
		b[ind] = true;
	}
	if (n == 1) {
		cout << t / a[0] << '\n';
		return;
	}
	vector<int> prefs(n + 1);
	for (int i = 0; i < n; i++) {
		prefs[i + 1] = prefs[i] + a[i];
	}
	for (int i = 0; i < n; i++) {
		if (!b[i]) continue;
		int l = 0;
		int r = i + 2;
		while (l + 1 != r) {
			m = (l + r) / 2;
			if (prefs[i + 1] - prefs[i - m + 1] <= t) {
				l = m;
			}
			else {
				r = m;
			}
		}
		if (l == i + 1) {
			l += (t - prefs[i + 1]) / a[0];
		}
		cout << l << '\n';
	}
}

signed main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	int tt = 1;// cin >> tt;
	while (tt--) solve();
}
