#include #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair P; ll n,x,a,b; int main(void){ scanf("%lld",&n); scanf("%lld",&x); scanf("%lld",&a); scanf("%lld",&b); ll maxi=1LL<<(n-1); ll ans=(x+a-1LL)/a; ll ans2=(maxi-x+b-1LL)/b; ll v=min(ans,ans2); if(!(v*a>=x) && !(b*v>=(maxi-x)))while(1); printf("%lld\n",min(ans,ans2)); return 0; }