#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int roundup = round(sqrt(n));
    long long int root = sqrt(n);
    double droot = sqrt(n);
    long long int ans = roundup + (root - 1);
    if (droot == root) {
      ans = (root - 1) + (root - 1);
      cout << ans << endl;
      continue;
    }
    cout << ans << endl;
  }
  return 0;
}
