#include using namespace std; /* alias */ // type using ull = unsigned long long; using ll = long long; using ld = long double; // pair using pii = pair; // vector using vi = vector; using vl = vector; using vll = vector; using vvi = vector; using vvl = vector; using vvll = vector; using vs = vector; using vpii = vector; /* define short */ #define mp make_pair #define all(obj) (obj).begin(), (obj).end() #define YesNo(bool) if(bool){cout<<"Yes"<=0;i--) #define rrepd(i,n) for(ll i=n;i>=1;i--) //定数 #define inf 2147483647; #define INF 9223372036854775807; /* func */ inline int in_int() {int x; cin >> x; return x;} inline ll in_ll() {ll x; cin >> x; return x;} inline double in_double() {{double x; cin >> x; return x;}} inline string in_str() {string x; cin >> x; return x;} inline int ctoi(char c) {return c - '0';} templatebool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } int main() { ll h, a; cin >> h >> a; ll ans = 1; while(true) { ans += ans * 2; h/=a; if (h/a <= 0) { cout << ans << endl; break; } } }