#include <bits/stdc++.h>
using namespace std;
long long T, N;
inline long long f(long long k) {
  return min(N - k, (k * (k - 1)) / 2) + N - k;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> T;
  while (T--) {
    cin >> N;
    long long lo = 1, hi = N;
    while (hi - lo > 2) {
      long long mid1 = (lo + hi) >> 1;
      long long mid2 = (mid1 + hi) >> 1;
      if (f(mid2) > f(mid1))
        lo = mid1;
      else
        hi = mid2;
    }
    cout << max({f(lo), f(lo + 1), f(lo + 2)}) << "\n";
  }
  return 0;
}
