#include <bits/stdc++.h>
using namespace std;
int q;
long long n;
long long judge(long long k) { return n - k + min(n - k, (k * k - k) / 2); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (cin >> q; q; q--) {
    cin >> n;
    long long l = 1, r = n;
    while (l < r - 2) {
      long long lmid = (l + r) >> 1;
      long long rmid = (lmid + r) >> 1;
      if (judge(lmid) < judge(rmid))
        l = lmid;
      else
        r = rmid;
    }
    cout << max(judge(r), judge((l + r) >> 1)) << "\n";
  }
  return 0;
}
