#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int t;
  cin >> t;
  while (t--) {
    int a;
    cin >> a;
    int ans = a;
    for (int i = 1; i <= 70000; i++) {
      int s = (i - 1) + (a - 1) / i;
      ans = ans < s ? ans : s;
    }
    cout << ans << endl;
  }
  return 0;
}
