#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; int main(){ int N, D; cin >> N >> D; vector x, v; rep(i,N){ double a; cin >> a; x.push_back(a); } rep(i,N){ double a; cin >> a; v.push_back(a); } double dsum = 0; double t = 0; while(true){ double mn = -1; int idx = -1; rep(i,x.size()-1){ double tmp = (x[i+1]-x[i]) * (double)(v[i]-v[i+1]); if(tmp < 0) continue; if(mn < 0 || mn > tmp){ mn = tmp; idx = i; } } if(idx != -1){ double dadd = 0; vector nx, nv; rep(i,x.size()){ if(idx == i){ dadd += mn * v[i]; dadd += mn * v[i+1]; nx.push_back(x[i] + mn * v[i]); nv.push_back(v[i]+v[i+1]); i++; }else{ dadd += mn * v[i]; nx.push_back(x[i] + mn * v[i]); nv.push_back(v[i]); } } if(dsum + dadd > D){ break; }else{ x = nx; v = nv; dsum += dadd; } }else{ break; } } double lb = 0, ub = D+1; rep(t,120){ double m = (lb+ub)/2; double sum = 0; rep(i,v.size()){ sum += v[i] * m; } if(dsum + sum < D) lb = m; else ub = m; } t += lb; cout << (double)ceil(t) << endl; return 0; }