#include #include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); }; } fio; int cal(int x, int n){ int sum = 0; for(int i = 0; i < n; i++){ if(x <= 0) return -1; sum += x; x /= 2; } return sum; } signed main(){ cout<>D; for(int i = 1; i <= 60; i++){ int l = 0, h = D+1, m; while(l + 1 < h){ m = (l + h) / 2; if(cal(m, i) < D) l = m; else h = m; } if(cal(h, i) == D) ans = min(ans, h); } cout<