#include <bits/stdc++.h>
using namespace std;
long long c1(long long k) {
  if (k % 2 == 0)
    return k / 2 * (k - 1);
  else
    return (k - 1) / 2 * k;
}
long long f(long long n, long long k) { return n - k + min(n - k, c1(k)); }
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long x;
    cin >> x;
    long long low = 1;
    long long high = x;
    while (high >= low) {
      long long mid = low + (high - low) / 2;
      if (f(x, mid) > f(x, mid + 1))
        high = mid - 1;
      else
        low = mid + 1;
    }
    cout << f(x, low) << endl;
  }
}
