#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int l, r;
    l = 0, r = n;
    long long int ans, mid;
    long long int here;
    while (l <= r) {
      mid = l + (r - l) / 2;
      here = (mid / 2) + 1;
      here = here + (mid - (mid / 2)) * here;
      if (here >= n) {
        ans = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    cout << ans << endl;
  }
}
