#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int k = sqrt(n), a, b;
    if ((k - 1) * (k - 1) >= n) {
      cout << k - 2 + k - 2 << endl;
    } else if ((k - 1) * (k) >= n) {
      cout << k - 2 + k - 1 << endl;
    } else if ((k * k) >= n) {
      cout << k - 1 + k - 1 << endl;
    } else if ((k + 1) * (k) >= n) {
      cout << k + k - 1 << endl;
    } else {
      cout << k + k << endl;
    }
  }
}
