t = int(input()) for i in range(t): n = int(input()) nn = int(n ** (1/2)) if (nn-1) ** 2 <= n < nn ** 2: nn -= 1 elif (nn+1) ** 2 < n <= (nn+2) ** 2: nn += 1 print(nn)