//优化#pragma GCC optimize(2)//C#include<string.h>#include<stdio.h>#include<stdlib.h>#include<math.h>//C++//#include<unordered_map>#include<algorithm>#include<iostream>#include<istream>#include<iomanip>#include<climits>#include<cstdio>#include<string>#include<vector>#include<cmath>#include<queue>#include<stack>#include<map>#include<set>//宏定义#define N 2010#define DoIdo main//#define scanf scanf_s#define it set<ll>::iterator//定义+命名空间typedeflonglong ll;typedefunsignedlonglong ull;const ll mod =998244353;const ll INF =1e18;constint maxn =5e6+10;usingnamespace std;//全局变量constdouble pi =acos(-1);//函数区
ll max(ll a, ll b){return a > b ? a : b;}
ll min(ll a, ll b){return a < b ? a : b;}//主函数intDoIdo(){
ios::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);int T;
cin >> T;while(T--){int n;
cin >> n;int ans =1;for(int i =2; i * i <= n; i++){if(n % i ==0){int cnt =0;while(n % i ==0){ n /= i; cnt++;}
ans *=(cnt *2+1);}}if(n >=2) ans *=3;
cout << ans /2+1<< endl;}return0;}//分割线---------------------------------QWQ/*
*/