#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n >> x >> a >> b; // 普通にたたく ll attack_num; if(x%a==0){ attack_num = x/a; }else{ attack_num = x/a + 1; } // 回復 ll overflow = pow(2, n-1); ll rest = overflow - x; ll heal_num; if(rest%b==0){ heal_num = rest/b; }else{ heal_num = rest/b + 1; } ll ans = min(attack_num, heal_num); p(ans); return 0; }