#include <bits/stdc++.h>
using namespace std;
void solve() {
  int x;
  cin >> x;
  int l = 0;
  int r = x - 1;
  auto f = [&](int x) { return x * 1ll * (x - 1) / 2; };
  auto get = [&](int x, long long pos) {
    long long all = min(pos + pos, pos + f(x - pos));
    return all;
  };
  while (l + 2 < r) {
    int pos1 = l + (r - l) / 3;
    int pos2 = r - (r - l) / 3;
    if (get(x, (long long)pos1) > get(x, (long long)pos2))
      r -= (r - l) / 3;
    else
      l += (r - l) / 3;
  }
  long long res = 0;
  for (int i = l; i <= r; ++i) {
    if (get(x, (long long)i) > res) res = get(x, (long long)i);
  }
  cout << res << '\n';
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t-- > 0) solve();
}
