#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    long long l = 0, r = n - 1;
    long long ans = 0;
    while (l <= r) {
      long long mid = (l + r) / 2;
      long long k = mid;
      long long kmax = 1LL * (n - k) * (n - k - 1) / 2;
      if (k > kmax) {
        ans = max(ans, k + kmax);
        r = mid - 1;
      } else {
        ans = max(ans, 2 * k);
        l = mid + 1;
      }
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
