#include
#include
#include
#include
#include
using namespace std;
typedef long long LL;
LL n;
int main(){
int T,nc = 1;
scanf("%d",&T);
while(T--){
LL x,y;
cin>>n;
LL k1 = floor(sqrt(n));
if(k1*k1 == n) k1--;
LL k2 = k1+1;
LL mid = (k1*k1+1+k2*k2)>>1;
//cout<mid){
cout<mid){
cout<