#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define PI acos(-1)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int N = 1e9 + 19;
const int M = 1e5 + 19;
const ll mod = 1e9 + 7;

int a[M];

void init()
{
    for(int i = 3; i * i < 2 * N; i++)
    {
        if(i * i % 2)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
}

int main()
{
    init();
    int T;
    cin >> T;
    while(T--)
    {
        int n;
        cin >> n;
        cout << a[(int)sqrt(2 * n - 1)] << endl;
    }
}
