def f(l,r,n,ans)
	return ans if r<l
	m=(l+r)/2
	m2=m*m
	if m2<=n && ans<m then
		ans=m
	end
	if l==r || m2==n then
		return ans
	else
		if n<m*m then
			return f(l,m-1,n,ans)
		else
			return f(m+1,r,n,ans)
		end
	end
end
n=gets.to_i
n.times{
	t=gets.to_i
	puts f(1,t,t,1)
}