#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, d; cin >> n >> d; vector x(n), v(n); REP (i, n) cin >> x[i]; REP (i, n) cin >> v[i]; int ub = 1e9; int lb = -1; while (ub - lb > 1) { long long t = (lb + ub) / 2; long long sum = 0; REP (i, n) sum += t * v[i]; if (sum >= d) ub = t; else lb = t; } cout << ub << endl; return 0; }