#include using namespace std; #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; typedef long double ld; using P=pair; const ld INF=1e18; const int mod=1e9+7; ll f(ll a,ll b){ ll res=1; rep(i,b){ res*=a; } return res; } void solve(){ vectors(1000001); rep(i,1001){ s[i*i]=1; } vectort; for(int i=3;i<=60;i+=2){ ll j=1; ll lim=pow(1e18+10000,1.0/i); while(j<=lim){ if(!s[j]){t.push_back(f(j,i));} j++; } } sort(t.begin(),t.end()); t.erase(unique(t.begin(),t.end()),t.end()); auto calc=[&](ll n){ ll l=0,r=1e9+5; while(r-l>1){ ll mid=(l+r)/2; if(mid*mid<=n){ l=mid; } else{ r=mid; } } ll add=upper_bound(t.begin(),t.end(),n)-t.begin(); return l+add; }; int T; cin>>T; rep(i,T){ ll k; cin>>k; ll l=0,r=1e18; while(r-l>1){ ll mid=(l+r)/2; if(calc(mid)>=k){r=mid;} else{l=mid;} } cout<