#include <bits/stdc++.h>
using namespace std;
const long long int mod = (1e+9) + 7;
const long long int max = 2e5 + 9;
bool prime[10000];
map<long long int, long long int> mp;
void sieve(long long int n) {
  memset(prime, true, sizeof(prime));
  for (long long int i = 2; i * i <= n; i++) {
    if (prime[i]) {
      for (long long int p = i * i; p <= n; p += i) prime[p] = false;
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= n; i++) {
    if (prime[i]) {
      cnt++;
    }
    mp[i] = cnt;
  }
}
void showvec(vector<long long int> v) {
  long long int n = v.size();
  for (long long int i = 0; i < n; i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
void showarr(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
void factors(long long int n) {
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      cout << i << " ";
      if (n / i != i) {
        cout << n / i << " ";
      }
    }
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int sqroot = floor(sqrt(n)), ans = 2 * sqroot;
    if ((sqroot) * (sqroot) >= n)
      ans -= 2;
    else if ((sqroot + 1) * sqroot >= n)
      ans -= 1;
    cout << ans << "\n";
  }
}
