#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7f7f7f7f;
int main() {
  int _, n;
  scanf("%d", &_);
  while (_--) {
    scanf("%d", &n);
    long long cnt, minn = inf;
    for (int i = 1; i <= n; i++) {
      cnt = i - 1;
      cnt += (n - i) / i;
      if (n % i) {
        cnt++;
      }
      if (cnt <= minn) {
        minn = cnt;
      } else {
        break;
      }
    }
    printf("%lld\n", minn);
  }
}
