#include "bits/stdc++.h" using namespace std; #define ll long long #define rep(i,n) for(int i = 0; i < (n); i++) const int inf = 1e9 + 11; int MOD = 1e9 + 7; const ll INF = 1LL << 60; int main() { ll n, d; cin >> n >> d; vectorx(n), u(n); rep(i, n)cin >> x[i]; rep(i, n)cin >> u[i]; ll l = 0, r = 5e9; while (r - l > 1) { int mid = (l + r) / 2; ll now = 0; rep(i, n) { now += mid * u[i]; } if (now >= d) { r = mid; } else l = mid; } cout << r << endl; return 0; }