#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int q;
  cin >> q;
  while (q--) {
    long long int n;
    cin >> n;
    long long int s = 1, e = n - 1, ans = 0, mid;
    while (s <= e) {
      mid = (s + e) / 2;
      long long int x = (n - mid) * (n - mid - 1) / 2;
      ans = max(ans, mid + min(x, mid));
      if (x < mid)
        e = mid - 1;
      else
        s = mid + 1;
    }
    cout << ans << '\n';
  }
}
