#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long now = floor(sqrt(n));
    long long tim = (now - 1) * 2;
    n -= now * now;
    if (n == 0)
      cout << tim;
    else if (n > now)
      cout << tim + 2;
    else
      cout << tim + 1;
    cout << endl;
  }
  return 0;
}
