#include int n, x, a, b; int main() { scanf("%d %d %d %d", &n, &x, &a, &b); int max = 1; for (int i = 0; i < n - 1; i++) max *= 2; max--; int at = 0; int hp = x; while (hp > 0) { hp -= a; at++; } int re = 0; hp = x; while (hp <= max) { hp += b; re++; } if (at > re) printf("%d\n", re); else printf("%d\n", at); }