#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define un unsigned long long
using namespace std;
un n,m,k,a[200001],h[200001];
bool j(un x){
un sum=0;
FOR(i,1,n) if(h[i]+x*a[i]>k){
sum+=h[i]+x*a[i];
if(sum>=m) return true;
}
return false;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n>>m>>k;
FOR(i,1,n) cin>>h[i];
FOR(i,1,n) cin>>a[i];
if(j(0)){
cout<<0;
return 0;
}
un l=0,r=1e18;
while(l<r){
un mid=(l+r)>>1;
if(j(mid)){
r=mid;
}else{
l=mid+1;
}
}
cout<<l;
return 0;
}
无语死了,点1WA这种水题都能错,不活了