#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int value = sqrt(n);
  long long int answer = 2 * value - 2;
  long long int diff = (n)-value * value;
  if (diff % value == 0) {
    answer += (diff) / value;
  } else {
    answer += ((diff) / value) + 1;
  }
  cout << answer << endl;
}
int main() {
  long long int t;
  cin >> t;
  while (t--) solve();
}
