#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    double x = (double)(8 * n + 1);
    x = (double)(sqrt(x));
    x = x - 1;
    x = x / 2;
    long long xx = floor(x);
    long long ans = (xx * (xx - 1)) / 2;
    ans = ans + n - xx;
    xx++;
    long long ans2 = 2 * (n - xx);
    cout << max(ans, ans2) << endl;
  }
}
