#include <bits/stdc++.h>
const int inf = (1e9 + 3);
const int M97 = ((int)1e9 + 7);
using namespace std;
vector<int> squares;
long long int i, j, k;
void solve() {
  int n;
  cin >> n;
  int x = upper_bound(squares.begin(), squares.end(), n) - squares.begin();
  long long int ans = 2 * x - 2;
  if (n > x * x) {
    ans++, n -= x * (x + 1);
    if (n > 0) ans++;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  i = 1;
  while (i * i <= 1e9) squares.push_back(i * i), i++;
  long long int T;
  cin >> T;
  while (T--) solve();
  return 0;
}
