#include <bits/stdc++.h>
using namespace std;
void solve() {
  long double n;
  cin >> n;
  long double root = (sqrt(n) - 1);
  cout << ceil(2 * root) << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
