// WA floor #include #include #include using namespace std; int main(){ long long n,x,a,b; cin >> n >> x >> a >> b; assert( 2<= n && n<=32 ); assert( 1 <= x && x < (1LL<<(n-1)) ); assert( 1 <= a && a < (1LL<<(n-1)) ); assert( 1 <= b && b < (1LL<<(n-1)) ); long long ans = min( floor((x + 0.0)/a), floor( ((1LL<<(n-1)) - x + 0.0)/b) ); cout << ans << endl; return 0; }