#include #include #include #include #define MAX (long long int)1e18 int check[110]; std::vector prime; std::map M; long long int func(int k, int mul,long long int val) { if(mul>60) return 0; if(k==prime.size()) { if(mul==1) return 0; double t = std::pow(val,1.0/mul); long long int s = (long long int)t; while(1) { long long int val2 = val; for(int i=1;i<=mul;i++) val2/=(s+1); if(val2==0) return s; else s++; } return (long long int)t-1; } long long int s1 = func(k+1,mul,val); long long int s2 = func(k+1,mul*prime[k],val); return s1-s2; } int main() { for(int i=2;i<=60;i++) { if(check[i]==0) { prime.push_back(i); for(int j=i;j<=60;j+=i) check[j] = 1; } } int T; scanf("%d",&T); while(T--) { int a; scanf("%d",&a); long long int min = 1, max = MAX; long long int ans = MAX; while(min<=max) { long long int h = (min+max)/2; long long int s = -func(0,1,h)+1; if(s>=a) { ans = h; max = h-1; } else min = h+1; } printf("%lld\n",ans); } }