#include <bits/stdc++.h>
const unsigned int MOD = 1000000007;
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int ans = sqrt(n);
    if (ans * ans == n)
      cout << (2 * ans) - 2 << endl;
    else if ((ans + 1) * ans >= n)
      cout << (2 * ans) - 1 << endl;
    else
      cout << 2 * ans << endl;
  }
  return 0;
}
