#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(x) x.begin(), x.end()
#define siz(x) int(x.size())
#define ceil(a, b) (((a) + (b) - 1) / (b))
const int INF = 2e9 + 7;
const ll LINF = 1e18 + 7;
const int mxN = 3e5 + 10;
const int K = 600;
const int CNT = 600;

int n, m, T, a[mxN], ptr[CNT];
ll pref[mxN], ans[mxN];
vector<pair<int, double>> opt[CNT]; // j, time p-j
ll sum(int l, int r) {
    if(r < 0 || n <= l || r < l) return 0;
    ll res = pref[r];
    if(l) res -= pref[l - 1];
    return res;
}
ll calc(int s, int t) {
    if((s <= t ? sum(s, t - 1) : sum(t + 1, s)) > T) return 0;
    return abs(s - t) + (T - (s <= t ? sum(s, t - 1) : sum(t + 1, s))) / a[t];
}
void solve() {
    cin >> n >> m >> T;
    for(int i = 0; i < n; ++i) {
        cin >> a[i];
        pref[i] = (i ? pref[i - 1] : 0) + a[i];
    }

    if(n > 600) {
        for (int b = 0; b < CNT; ++b) {
            int l = b * K;
            for (int j = b * K; j < min(n, (b + 1) * K); ++j) {
                int p = siz(opt[b]) ? opt[b].back().first : -1;
                if (opt[b].empty()) opt[b].push_back({j, -INF});
                else if (a[j] < a[p]) {
                    double t =
                            ((j - p) * a[j] * a[p] + sum(l, p - 1) * a[j] - sum(l, j - 1) * a[p]) * 1.0 / (a[j] - a[p]);
                    opt[b].push_back({j, t});
                }
            }
            ptr[b] = siz(opt[b]) - 1;
        }
    }
    for(int i = n - 1; i >= 0; --i) {
        int ib = i / K;
        for(int j = ib * K; j < min(n, (ib + 1) * K); ++j) {
            ans[i] = max(ans[i], calc(i, j));
        }
        if(n > 600) {
            for (int jb = ib + 1; jb < CNT; ++jb) {
                int l = jb * K;
                if (l >= n) break;
                int t = T - sum(i, l - 1);
                while (ptr[jb] >= 0 && opt[jb][ptr[jb]].second >= t) ptr[jb]--;
                if (ptr[jb] >= 0) ans[i] = max(ans[i], calc(i, opt[jb][ptr[jb]].first));
            }
        }
    }

    if(n > 600) {
        for (int b = 0; b < CNT; ++b) {
            opt[b].clear();
            int r = min(n, (b + 1) * K) - 1, l = b * K;
            if (l >= n) break;
            for (int j = r; j >= b * K; --j) {
                int p = siz(opt[b]) ? opt[b].back().first : -1;
                if (opt[b].empty()) opt[b].push_back({j, -INF});
                else if (a[j] < a[p]) {
                    double t =
                            ((p - j) * a[j] * a[p] + sum(p + 1, r) * a[j] - sum(j + 1, r) * a[p]) * 1.0 / (a[j] - a[p]);
                    opt[b].push_back({j, t});
                }
            }
            ptr[b] = siz(opt[b]) - 1;
        }
        for (int i = 0; i < n; ++i) {
            int ib = i / K;
            for (int jb = 0; jb < ib; ++jb) {
                int r = min(n, (jb + 1) * K) - 1;
                int t = T - sum(r + 1, i);
                while (ptr[jb] >= 0 && opt[jb][ptr[jb]].second >= t) ptr[jb]--;
                if (ptr[jb] >= 0) ans[i] = max(ans[i], calc(i, opt[jb][ptr[jb]].first));
            }
        }
    }
    ll mx = 0;
    for(int i = 0; i < m; ++i) {
        int x;
        cin >> x;
        mx = max(mx, ans[x - 1]);
    }
    cout << mx;
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cout << fixed; cout.precision(8);
#ifdef INEYOK
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    solve();
}
