import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) T = int(input()) for _ in range(T): N = int(input()) Nsq = int(N ** 0.5) for i in range(2, -3, -1): if (Nsq + i) ** 2 <= N: print(Nsq + i) break