#include #include using namespace std; int n, x, a, b, ma_health; int main() { freopen("fantasy.in", "r", stdin); freopen("fantasy.out", "w", stdout); scanf("%d%d%d%d", &n, &x, &a, &b); ma_health = 1 << (n - 1); printf("%d\n", min((x + a - 1) / a, (ma_health - x + b - 1) / b)); return 0; }