#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
long long N;
long long f(int k) { return N - k + min(1ll * k * (k - 1) / 2, 1ll * N - k); }
void solve() {
  long long lo = 1, hi = N;
  while (hi > lo + 3) {
    long long lef = (lo + lo + hi) / 3;
    long long rig = (lo + hi + hi) / 3;
    long long lef_val = f(lef);
    long long rig_val = f(rig);
    if (lef_val >= rig_val)
      hi = rig;
    else
      lo = lef;
  }
  long long mx = -1;
  for (long long x = lo; x <= hi; x++) mx = max(mx, f(x));
  cout << mx << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    cin >> N;
    solve();
  }
  return 0;
}
