from sys import stdin def main(): input = lambda: stdin.readline()[:-1] T = int(input()) for _ in [0] * T: N = int(input()) n = int(N ** 0.5) + 1 if n * n <= N: print(n) elif (n - 1) * (n - 1) <= N: print(n - 1) else: print(n - 2) main()