#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 100;
const int inf = 0x3f3f3f3f;
int a[maxn];
long long n;
bool check(long long b) {
  long long x = min(b, (b + 1) / 2), y = min(b, x + 1);
  if (x * x - b * x - b + n - 1 <= 0) return 1;
  if (y * y - b * y + n - 1 - b <= 0) return 1;
  return 0;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    int L = 0, R = 70000;
    int ans;
    while (L < R) {
      int mid = L + R >> 1;
      if (check(mid) == 1)
        R = mid, ans = mid;
      else
        L = mid + 1;
    }
    cout << ans << endl;
  }
  return 0;
}
