#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAX = 2e5 + 100;
const ll inf = 1e17;
const ll mod = 1e9 + 7;
ll tc, n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> tc;
  while (tc--) {
    cin >> n;
    if (n <= 5) {
      cout << n - 1 << endl;
      continue;
    }
    ll ini = n / 2, fin = n;
    while (ini < fin) {
      ll mid = (ini + fin + 1) / 2;
      if (((n - mid) * (n - mid - 1)) / 2 >= mid)
        ini = mid;
      else
        fin = mid - 1;
    }
    cout << max(2 * ini, ini + 1 + ((n - ini - 1) * (n - ini - 2)) / 2) << endl;
  }
}
