#include <bits/stdc++.h>
using namespace std;
int t;
long long n;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    long long num;
    for (long long i = 1; i < n; i++) {
      if (i * i > n) {
        num = i - 1;
        break;
      } else if (i * i == n) {
        num = i;
        break;
      }
    }
    long long out = 0;
    if (n == 1) {
      out = 0;
    } else if (n == 2) {
      out = 1;
    } else if (num * num == n) {
      out = (num - 1) * 2;
    } else if (num * (num + 1) >= n) {
      out = 2 * num - 1;
    } else {
      out = 2 * num;
    }
    cout << to_string(out) << endl;
  }
  return 0;
}
