P8754 [Lanqiao Cup 2021 NOI Qualifier AB2] Perfect Square Number

Description

An integer $a$ is a perfect square number, meaning it is the square of some integer. That is, there exists an integer $b$ such that $a=b^{2}$. Given a positive integer $n$, find the smallest positive integer $x$ such that their product is a perfect square number.

Input Format

The input contains one line with a positive integer $n$.

Output Format

Output the smallest positive integer $x$ found.

Explanation/Hint

For $30\%$ of the testdata, $1 \leq n \leq 1000$, and the answer does not exceed $1000$. For $60\%$ of the testdata, $1 \leq n \leq 10^{8}$, and the answer does not exceed $10^{8}$. For all testdata, $1 \leq n \leq 10^{12}$, and the answer does not exceed $10^{12}$. Lanqiao Cup 2021, Second Round Provincial Contest, Group A Problem G (Group B Problem H). Translated by ChatGPT 5