#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long s = sqrt(n);
  long long ans = 0x7fffffffffffffffLL;
  for (long long x = max(s - 5, 0LL); x <= s + 5; x++) {
    long long c = (n - 1) / (x + 1);
    ans = min(ans, x + c);
  }
  cout << ans << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
