#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
int x[205], y[205];
int main() {
  int T;
  int n, m;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    int x = sqrt(n);
    if (x * x == n) {
      printf("%d\n", x + x - 2);
    } else if (x * x + x >= n) {
      printf("%d\n", x + x - 1);
    } else {
      printf("%d\n", x + x);
    }
  }
  return 0;
}
