// No.300 平方数 // https://yukicoder.me/problems/no/300 // #include #include using namespace std; long long int solve(long long int X); unordered_map prime_factor(long long int n); int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); long long X; cin >> X; long long ans = solve(X); cout << ans << endl; } long long int solve(long long int X) { unordered_map res; res = prime_factor(X); long long ans = 1; for (auto f: res) { if (f.second % 2 == 1) { ans *= f.first; } } return ans; } unordered_map prime_factor(long long int n) { unordered_map res; for (long long i = 2; i*i <= n; ++i) { while (n % i == 0) { ++res[i]; n /= i; } } if (n != 1) res[n] = 1; return res; }