#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int _sqrt = sqrt(n);
  while ((_sqrt * _sqrt) < n) _sqrt++;
  long long int ans = _sqrt - 1;
  long long int number = _sqrt;
  while (true) {
    if (number >= n) break;
    number += _sqrt;
    ans++;
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  while (t--) solve();
}
