#include using namespace std; int main() { int N; long long D; cin >> N >> D; vector x( N ); for( int i = 0; i < N; i++ ) { cin >> x[i]; } vector v( N ); for( int i = 0; i < N; i++ ) { cin >> v[i]; } const long long INF = INT64_MAX / 2; auto f = [&]( __int128_t t ) -> __int128_t { __int128_t res = 0; for( int i = 0; i < N; i++ ) { res += v[i] * t; } return res; }; long long l = 0; long long r = INF; while( r - l > 1 ) { long long m = (l + r) / 2; if( f( m ) >= D ) r = m; else l = m; } long long ans = r; cout << ans << endl; }