#include <bits/stdc++.h>
using namespace std;
int check();
int main() {
  long long n, j, min(1e9), t, a = 0;
  vector<int> b;
  vector<long long> ans;
  cin >> t;
  if (t <= 1000 && t >= 1) {
    for (int i = 0; i < t; i++) {
      cin >> n;
      ans.clear();
      if (n <= 1E9 && n >= 1) {
        a = sqrt(n);
        for (int i = 1; i <= a; i++) {
          j = (a - 1 + ((n - a) + a - 1) / a);
          ans.push_back(j);
        }
      }
      min = 1e9;
      for (int i = 0; i < a; i++) {
        if (min > ans[i]) {
          min = ans[i];
        }
      }
      cout << min << endl;
    }
  }
  return 0;
}
int check() { return 0; }
