#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int m = sqrt(n);
    if (m * m < n) {
      m++;
    }
    cout << m + (n - 1) / m - 1 << endl;
  }
}
