//karanaggarwal #include using namespace std; #define TRACE #ifdef TRACE #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template void __f(const char* name, Arg1&& arg1){ cerr << name << " : " << arg1 << std::endl; } template void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...); } #else #define trace(...) #endif #define si(x) scanf("%d",&x) #define sll(x) scanf("%lld",&x) #define pi(x) printf("%d\n",x) #define F first #define S second #define PB push_back #define MP make_pair #define LET(x,a) __typeof(a) x(a) #define TR(v,it) for( LET(it,v.begin()) ; it != v.end(); it++) typedef long long LL; typedef pair PII; typedef vector VI; typedef vector VPII; const int mod = 1000000007; LL gcd(LL a, LL b){ if(b)return gcd(b,a%b); return a;} VI primes; const int N = 1000001; bitset P; LL A[100]; int main(int argc, char** argv) { P.set(); for(int i =2; i*i<=1000000; i++) if(P[i]==true) for(int j = i*i; j<=1000000; j+=i) P[j] = false; for(int i =2; i<=1000000; i++) if(P[i]) primes.PB(i); int t; si(t); while(t--) { int n; si(n); for(int i =0; i A[i])break; if(A[i] % x)continue; A[i]/=x; if(A[i]%x==0){ g = x; break; } } if(g==1){ LL r = sqrt(A[i]); while(r*r > A[i])r--; while(r*r < A[i])r++; if(r*r==A[i]) g = r; } } // assert(g!=1); cout<