#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll n, d;
    cin >> n >> d;
    vector<ll> x(n), v(n);
    rep(i, 0, n) cin >> x[i];
    rep(i, 0, n) cin >> v[i];
    double l = 0, r = 1e20;
    while(r - l > 1) {
        ll m = l + (r - l) / 2;
        double sum = 0;
        rep(i, 0, n) sum += v[i] * m;
        if(sum >= d) r = m;
        else l = m;
    }
    cout << (ll)r << endl;
    return 0;
}