#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int root = sqrt(n);
    int ans = 0;
    if (n == 1) {
      cout << ans << endl;
      continue;
    } else {
      ans = ceil((root - 1) + (double(n - root) / root));
    }
    cout << ans << endl;
  }
}
