/*** author: yuji9511 ***/ #include using namespace std; using ll = long long; using lpair = pair; const ll MOD = 1e9+7; const ll INF = 1e18; #define rep(i,m,n) for(ll i=(m);i<(n);i++) #define rrep(i,m,n) for(ll i=(m);i>=(n);i--) #define printa(x,n) for(ll i=0;i void print(H&& h, T&&... t){cout<(t)...);} void solve(){ ll N,D; cin >> N >> D; ll x[100010], v[100010]; rep(i,0,N) cin >> x[i]; rep(i,0,N) cin >> v[i]; ll lv = 0, rv = 1e9+7; while(rv - lv > 1){ ll mid = (lv + rv) / 2; bool ok = true; ll res = 0; rep(i,0,N) res += v[i]; if(res * mid < D) ok = false; if(ok){ rv = mid; }else{ lv = mid; } } print(rv); } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); }