#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int64_t x;
    cin >> x;
    int64_t sqr = int64_t(sqrt(x));
    if (sqr * sqr >= x) {
      cout << 2 * (sqr - 1) << endl;
    } else if (sqr * (sqr + 1) >= x) {
      cout << 2 * sqr - 1 << endl;
    } else
      cout << 2 * sqr << endl;
  }
  return 0;
}
