#include <bits/stdc++.h>
using namespace std;
const int nax = 1e7;
const int mod = 1e9 + 7;
long long int n;
long long int tryit(long long int a) {
  if (a >= n) {
    return a;
  }
  long long int b = (((n) + (a + 1) - 1) / (a + 1)) - 1;
  return a + b;
}
void func() {
  cin >> n;
  long long int s = 0, e = 1e10, ans;
  while (s <= e) {
    long long int mid = (s + e) / 2;
    long long int val = (1 + mid) * (1 + mid);
    if (val >= n) {
      ans = mid >= n ? mid : mid + (((n) + (mid + 1) - 1) / (mid + 1)) - 1;
      e = mid - 1;
    } else {
      s = mid + 1;
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    func();
  }
}
