#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int N = 300010;
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie(0);
  int T = 1;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int res = 0x3f3f3f3f;
    for (int i = 0; i <= 70000; i++) {
      int now = 1;
      now += i;
      if (now >= n) {
        res = min(res, i);
        break;
      } else {
        res = min(res, i + (n - now + now - 1) / now);
      }
    }
    cout << res << '\n';
  }
  return 0;
}
