#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC optimize("O3")

using namespace std;
//using namespace __gnu_pbds;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define int long long

//typedef tree<int, null_type,less<int>,  rb_tree_tag, tree_order_statistics_node_update> ordered_set;

signed main(){
    cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
    int n, m, T;
    cin>>n>>m>>T;
    vector<int> a(n);
    for(auto &x:a) cin>>x;
    vector<int> pr(n+1);
    for(int i = 1; i <= n; ++i){
        pr[i] = pr[i-1] + a[i-1];
    }
    vector<int> b(m);
    for(auto &x:b) cin>>x, --x;
    auto ok = [&](int x) -> bool{
        for(int i:b){
            for(int j = i; j < n; ++j){
                if (pr[j+1]-pr[i] > T) break;
                if (j*a[j] - i*a[j] + a[j] + T-pr[j+1]+pr[i] >= x * a[j]){
                    return true;
                }
            }
        }
        for(int i:b){
            for(int j = i; j >= 0; --j){
                if (pr[i+1]-pr[j] > T) break;
                if (T-pr[i+1] - i * a[j] >= x * a[j] - pr[j] - a[j] - j * a[j]){
                    return true;
                }
            }
        }
        return false;
    };
    int l = 0, r = (int)1e9;
    while(r - l > 1){
        int mid = (l+r)/2;
        if (ok(mid)) l = mid;
        else r = mid;
    }
    cout<<l<<'\n';
    return 0;
}
