#include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
    {
        long long a;
        scanf("%lld",&a);
        
        long long low=1;
        long long high=2000000000;
        long long lsn=0;

        while(low<=high)
        {
            long long mn=low+(high-low)/2;
            if(mn*mn<=a)
            {
                lsn=mn*mn;
                low=mn+1;
            }
            else
            {
                high=mn-1;
            }
        }
        printf("%lld\n",lsn);
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: