#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10240000000,10240000000")
using namespace std;
long long f(long long n, long long k) {
  return n - k + min(k * (k - 1) / 2, n - k);
}
int main() {
  long long q, n;
  cin >> q;
  while (q--) {
    cin >> n;
    long long l = 1, r = n;
    while (l < r - 1) {
      long long m = (l + r) >> 1;
      long long mm = (m + r) >> 1;
      long long fm = f(n, m);
      long long fmm = f(n, mm);
      if (fmm < fm)
        r = mm;
      else if (fmm > fm)
        l = m;
      else {
        l = m;
        r = mm;
      }
    }
    cout << (f(n, l) > f(n, r) ? f(n, l) : f(n, r)) << endl;
  }
  return 0;
}
