/*    ∫ ∫ ∫    ノヽ   (_  )  (_    ) (______ )  ヽ(´・ω・)ノ     |  /    UU */ #pragma region macro #include typedef long long int64; using namespace std; using P = pair; typedef vector vi; const int MOD = (int)1e9 + 7; const int64 INF = 1LL << 62; const int inf = 1<<30; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b ostream& operator<<(ostream& os, const vector &V){ int N = V.size(); REP(i,N){ os << V[i]; if (i!=N-1) os << " "; } os << "\n"; return os; } template ostream& operator<<(ostream& os, pair const&P){ os << "("; os << P.first; os << " , "; os << P.second; os << ")"; return os; } template ostream& operator<<(ostream& os, set &S){ auto it=S.begin(); while(it!=S.end()){ os << *it; os << " "; it++; } os << "\n"; return os; } template ostream& operator<<(ostream& os, deque &q){ for(auto it=q.begin();it ostream& operator<<(ostream& os, map const&M){ for(auto e:M){ os<> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)}; #pragma endregion //fixed<0; } const int MAX_bd = 31; // floor(log2(10^9)) = 29 void solve(){ int64 N; cin >> N; int64 ans=N*N-N; //1^a = 1^b ans += N*N; //a^b = a^b for(int b=1;b 1){ int mid = (ok+ng)/2; if(is_ok(mid,k,N)) ok = mid; else ng = mid; } ans += (N/k)*(ok-1); } } cout << ans << bn; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int N; cin >> N; REP(i,N) solve(); }