#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int T;
    cin >> T;
    while (T--) {
        long long x;
        cin >> x;

        long long res = sqrt(x);

        // 也是现在明白,sqrt函数对象如果太大的话会带来很大的误差,因为sqrt函数返回值类型是浮点数嘛,所以我们要保障它符合题目要求:res*res<=x,所以这就是ACCODE,感谢您愿意花时间看我的题解,谢谢。
        while (res * res > x) res--;  // 如果太大就减小

        cout << res << endl;
    }
    return 0;
}