#include #include #include #include #include #define LL long long using namespace std; const int MAXN = 110; const LL BigNum = 1e16; LL a[MAXN], sum[MAXN]; LL Solve(LL N) { if(N == 0) return 0; int pos; for(int i=1; i N) { pos = i; break; } } if(a[pos] == N) return sum[pos]; else return sum[pos] + Solve(N-a[pos]-1) + N - a[pos]; } int main() { a[1] = 1, sum[1] = 1; for(int i=2; i BigNum) break; } int T; scanf("%d", &T); while(T--) { LL N, ans; cin>>N; cout<