#include #define ll long long #define rep(i,x,n) for(ll i=x;i=n;i--) using namespace std; ll calc(ll n){ ll c=0; while(n>1) n/=2,c++; return c; } void solve(){ ll d; cin>>d; ll init=d,mx=calc(d),ans=0;//(1LL<<(mx-1LL)); // d-=((1LL<0) {d-= ((1LL<<(i+1LL))-1LL); ans+= (1LL<0) ans=init; cout<