
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename t>
ostream& operator<<(ostream& out, const vector<t> &v){
    for(auto x: v)out<<x<<" ";
    return out;
}
template <typename t>
istream& operator>>(istream& in,  vector<t> &v){
    for(auto &x: v)in>>x;
    return in;
}
template <typename t, typename u>
ostream& operator<<(ostream& out, const pair<t, u> p){
    out<<p.first<<" "<<p.second<<"\n";
    return out;
}
template <typename t, typename u>
istream& operator>>(istream& in,  pair<t, u> &p){
    in>>p.first>>p.second;
    return in;
}

struct line{
    int k;
    ll  b;
    line(int x = 0, ll y = -1e10){
        k = x, b = y;
    }
    ll get(int x){
        return 1ll*k*x+b;
    }
};
vector<int> pows;
void calc(int x){
    pows.resize(x+1);
    pows[1]=1;
    for(int i = 2; i<=x; i++){
        if(((i-1)&(i-2))==0){
            pows[i]=pows[i-1]*2;
        }
        else{
            pows[i]=pows[i-1];
        }
    }
}
struct LiTree{
    vector<line> t;
    int sz;
    LiTree(ll n=1){
        sz = pows[n+1];
        t.assign(2*sz+5, line(0, (ll)-1e10));
    }
    ll get(int idx){
        //cout<<idx<<"a\n";
        return _get(1, 0, sz, idx);
    }
    ll _get(int v, int tl, int tr, int idx){
        //cout<<v<<"b\n";
        int tm = (tr+tl)/2;
        ll c = 0;
        if(tl+1==tr){
            return t[v].get(idx);
        }
        if(tm>idx){
            c =  _get(2*v, tl, tm, idx);
        }
        else {
            c =  _get(2*v+1, tm, tr, idx);
        }
        return max(c, t[v].get(idx));
    }
    void add(line l){
        _update(1, 0, sz, l);
    }
    void _update(int v, int tl, int tr, line l){
        int tm = (tr+tl)/2;
        line l1 = t[v];
        if(l1.k<l.k){
            swap(l, l1);
        }
        if(tl+1==tr){
            if(l1.get(tl)>l.get(tm)){
                t[v]=l1;
            }
            else{
                t[v]=l;
            }
            return;
        }
        if(l1.get(tm)<l.get(tm)){
            t[v]=l;
            _update(2*v+1, tm, tr, l1);
        }
        else{
            t[v]=l1;
            _update(2*v, tl, tm, l);
        }
    }
};

struct SegTreeL{
    vector<LiTree> t;
    int sz;
    SegTreeL(vector<line> &v){
        if(v.size()==0){
            return;
        }
        sz = v.size();
        t.resize(4*sz);
        build(1, 0, sz, v);
    }
    void build(int v, int l, int r, vector<line> &a){
        if(l+1==r){
            t[v]= LiTree(1);
            t[v].add(a[l]);
        }
        else{
            int m =  (r+l)/2;
            build(2*v, l, m, a);
            build(2*v+1, m, r, a);
            t[v]=LiTree(r-l);
            for(auto lin: t[2*v].t){
                t[v].add(lin);
            }
            for(auto lin: t[2*v+1].t){
                t[v].add(lin);
            }
        }
    }
    ll get(int l, int r, int k){
        return _get(1, 0, sz, l, r, k);
    }
    ll _get(int v, int tl, int tr, int l, int r, int k){
        if(l<=tl&&tr<=r){
            return t[v].get(k);
        }
        ll tm = (tr+tl)/2;
        if(tm>=r){
            return _get(2*v, tl, tm, l, r, k);
        }
        if(tm<=l){
            return _get(2*v+1, tm, tr, l, r, k);
        }
        return max(_get(2*v, tl, tm, l, tm, k), _get(2*v+1, tm, tr, tm, r, k));
    }
};
ll solve2(ll n, ll m, ll t, vector<ll> &v, vector<ll> &v1){
    vector<ll> pref(n+1);
    for(int i = 0; i<n; i++){
        pref[i+1]=pref[i]+v[i];
    }
    ll le = 0, re = t+1;
    vector<line> vv;
    //SegTreeL sg = SegTreeL(vv);
    while(re-le>1){
        int mid = (re+le)/2;
        vector<ll> mx(n);
        vector<line> l(n+1);
        for(int i = 0; i<n; i++){
            l[i]=line(v[i], pref[i]-mid*v[i]-i*v[i]);
        }
        //sg = SegTreeL(l);
        // //cout<<re<<" "<<le<<"\n";
        // for(int i = 0; i<n; i++){
        //     int ind = lower_bound(pref.begin(), pref.end(), pref[i+1]-t)-pref.begin();
        //     mx[i]=sg.get(ind, i+1, i+1);
        //     mx[i]+=t-pref[i+1];
        // }
        //cout<<le<<" "<<re<<"\n";
        LiTree lt = n+1;
        for(int i = 0; i<n; i++){
            lt.add(l[i]);
            mx[i]=lt.get(i+1)+t-pref[i+1];
        }
        //cout<<mx<<"\n";
        int r1 = re;
        re = mid;
        for(auto ind: v1){
            if(mx[ind-1]>=0){
                re = r1;
                le = mid;

            }
        }
    }
    return le;
}
void solve () {
    int n, m, t;
    cin>>n>>m>>t;
    vector<ll> v(n), v1(m);
    cin>>v>>v1;
    calc(n+5);
    //cout<<pows<<"\n";
    ll ans = solve2(n, m, t, v, v1);
    reverse(v.begin(), v.end());
    for(int i = 0; i<m; i++){
        v1[i]=n+1-v1[i];
    }
    cout<<max(ans, solve2(n, m, t, v, v1))<<"\n";
}
signed main () {
    // ios_base::sync_with_stdio(0);
    // cin.tie(0);
    cout<<fixed<<setprecision(18);
    ll AnyaSamsonovaGoSex = 1;
    //cin>>AnyaSamsonovaGoSex;
    while(AnyaSamsonovaGoSex--) solve();
}