#include <bits/stdc++.h>
int main() {
  int T;
  std::cin >> T;
  for (int i = 0; i < T; ++i) {
    int n;
    std::cin >> n;
    int numb = int(std::ceil(sqrt(n)));
    int steps = numb - 1 + std::ceil(double(n - numb) / numb);
    std::cout << steps << std::endl << std::endl;
  }
}
