#include <bits/stdc++.h>
std::mt19937_64 rng(
    std::chrono::steady_clock::now().time_since_epoch().count());
long long int myRand(long long int R) {
  long long int val = rng() % R;
  assert(val >= 0);
  return val;
}
const long double PI = atan(1.0) * 4;
const int64_t INF64 = 3e18;
const int32_t INF32 = 2e9 + 7;
const int32_t LOG = 21;
const int32_t MOD = 1e9 + 7;
using namespace std;
void my_debugger(string second, long long int LINE_NUM) { cerr << '\n'; }
template <typename start, typename... end>
void my_debugger(string second, long long int LINE_NUM, start x, end... y) {
  if (second.back() != ',') {
    second += ',';
    cerr << "LINE(" << LINE_NUM << "): ";
  }
  long long int i = second.find(',');
  cerr << second.substr(0, i) << " = " << x;
  second = second.substr(i + 1);
  if (!second.empty()) cerr << ", ";
  my_debugger(second, LINE_NUM, y...);
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  long long int tests = 1;
  cin >> tests;
  for (long long int ii = 0; ii < (long long int)tests; ii++) {
    long long int n;
    cin >> n;
    long long int ans = n;
    for (long long int i = 0; i <= 63245; i++) {
      long long int num = (1 + i);
      long long int div = n / num;
      if (n % num != 0) div++;
      ans = min(ans, i + div - 1);
    }
    cout << ans << '\n';
  }
  return 0;
}
