#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
ll n,s,l;
ll hs[1145141];
ll as[1145141];
bool check(int m){
ull sum=0,x;
for(int i=0;i<n;i++){
x=hs[i]+as[i]*m;
if(x>=l) sum+=x;
else continue;
}
if(sum>=s) return 1;
else return 0;
}
int main(){
cin>>n>>s>>l;
for(int i=0;i<n;i++){
cin>>hs[i];
}
for(int i=0;i<n;i++){
cin>>as[i];
}
ll low=0,r=1e18,mid;
while(low<=r){
mid=(low+r)>>1;
if(check(mid)) r=mid-1;
else low=mid+1;
}
cout<<low;
}