#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>
#include<string>
#include<cstring>
#include<stack>
#include<queue>
#include<set>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define inf 0x3f3f3f3f;
typedef pair<int,int> PII;
typedef long long ll;
inline int lowbit(int x){//返回x二进制中最后一个1对应的十进制数字 
	return x&(-x);
}
inline int gcd(int x,int y){//最大公约数
	int z = y;
	while (x % y != 0)
	{
		z = x % y;
		x = y;
		y = z;
	}
	return z;
}
inline int lcm(int x,int y){//最小公倍数
	ll z = x * y;
	return z / gcd(x,y);
}
/*---------------------------------分界线------------------------------------------*/

const int N = 1e6+10;
ll t;

int main(){
	cin>>t;
	while(t--){
		int n;
		scanf("%d",&n);
		
		if(n == 1) cout<<1<<endl;
		else if(n == 2 || n == 3) cout<<2<<endl;
		else{
			int cnt1=2,cnt2=1;
			int sum1=3,sum2=1;
			int x1 = 2;
			while(sum1 < n){
				x1+=2;
				cnt1++;
				sum1+=x1;
				// cout<<x<<" ";
			}
			// cout<<endl;
			
			int x2=1;
			while(sum2 < n){
				x2+=2;
				cnt2++;
				sum2+=x2;
			}
			// cout<<cnt1<<endl<<cnt2<<endl;
			cout<<min(cnt1,cnt2)<<endl;
		}

	}
}