#include <bits/stdc++.h>   using namespace std;   long long n, q;   long long f(long long md) { return n - md + min(n - md, md * (md - 1) / 2); }   signed main() {     cin >> q;     while (q--) {       cin >> n;       long long lo = 1, hi = n;       while (lo + 1 < hi) {         long long md = (lo + hi) >> 1;         if (f(md) < f(md + 1))           lo = md;         else           hi = md;       }       cout << max(f(hi), f(lo)) << endl;     }     return 0;   }   