#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  long long n;
  for (long long i = 1; i <= T; i++) {
    cin >> n;
    if (n == 1)
      cout << 0 << endl;
    else {
      long long ans = 0x3f3f3f3f;
      for (long long j = 1; j <= n; j++) {
        long long tmp = j - 1;
        tmp += (n - j) / j;
        if (n % j != 0) tmp++;
        if (tmp > ans)
          break;
        else
          ans = tmp;
      }
      cout << ans << endl;
    }
  }
  return 0;
}
