#include <bits/stdc++.h>
using namespace std;
const int M = 1e5;
int T;
long long len, sum;
int n;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    int ans = 0, l = 0, r = M;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (mid * 1ll * mid + mid * 4ll + 4 >= n * 4ll)
        r = mid - 1, ans = mid;
      else
        l = mid + 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
