#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  int Q;
  cin >> Q;
  while (Q--) {
    int64_t N;
    cin >> N;
    auto f = [&](int64_t x) { return N - x + min(N - x, x * (x - 1) / 2); };
    int64_t lb = 1, ub = N;
    while (ub - lb > 3) {
      int64_t x = lb + (ub - lb) / 3;
      int64_t y = lb + (ub - lb) * 2 / 3;
      if (f(x) > f(y))
        ub = y;
      else
        lb = x;
    }
    int64_t ans = 0;
    for (int i = lb; i <= ub; ++i) {
      ans = max(ans, f(i));
    }
    cout << ans << endl;
  }
  return 0;
}
