#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n;
    int a = sqrt(n);
    int b = n / a;
    if (n % a != 0) ++b;
    cout << a + b - 2 << endl;
  }
  return 0;
}
