#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
using ll = long long;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 5;
ll f(ll k, ll n) { return n - k + min(k * (k - 1) / 2, n - k); }
ll solve(ll n) {
  ll lo = 1;
  ll hi = n + 1;
  while (hi - lo > 1) {
    ll mid = (lo + hi) / 2;
    if (f(mid, n) >= f(mid - 1, n)) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  return f(lo, n);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    ll n;
    cin >> n;
    cout << solve(n) << "\n";
  }
  return 0;
}
