#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, T;
  cin >> T;
  while (T--) {
    cin >> n;
    cout << ceil(2 * sqrt(n)) - 2 << ' ';
  }
}
