intgcd(int a, int b){ while (b) { int temp = a % b; a = b; b = temp; } return a; }
intCompute(longlong n){
bool IsNegetive = false; if (n < 0) { n = -n; IsNegetive = true; }
int Ans = 0;
constint MAX = ceil(sqrt(static_cast<double>(n))); for (int i = 2; i <= MAX; ++i) { if (n % i == 0) { int Temp = 0; while (n % i == 0) { n /= i; ++Temp; } Ans = gcd(Temp, Ans); } }
if (Ans == 0) { return1; }
if (IsNegetive) { while ((Ans & 1) == 0) { Ans >>= 1; } } return Ans; }