Happy New Year 2023

AtCoder
IDabc284_d
Time3000ms
Memory256MB
Difficulty
You are given a positive integer $N$. It is known that $N$ can be represented as $N=p^2q$ using two different prime numbers $p$ and $q$. Find $p$ and $q$. You have $T$ test cases to solve. ## Constraints * All values in the input are integers. * $1\leq T\leq 10$ * $1\leq N \leq 9\times 10^{18}$ * $N$ can be represented as $N=p^2q$ using two different prime numbers $p$ and $q$. ## Input The input is given from Standard Input in the following format, where $\text{test}_i$ represents the $i$\-th test case: $T$ $\text{test}_1$ $\text{test}_2$ $\vdots$ $\text{test}_T$ Each test case is in the following format: $N$ [samples]
Samples
Input #1
3
2023
63
1059872604593911
Output #1
17 7
3 7
104149 97711

For the first test case, we have $N=2023=17^2\times 7$. Thus, $p=17$ and $q=7$.
API Response (JSON)
{
  "problem": {
    "name": "Happy New Year 2023",
    "description": {
      "content": "You are given a positive integer $N$. It is known that $N$ can be represented as $N=p^2q$ using two different prime numbers $p$ and $q$. Find $p$ and $q$. You have $T$ test cases to solve.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 3000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc284_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a positive integer $N$. It is known that $N$ can be represented as $N=p^2q$ using two different prime numbers $p$ and $q$.\nFind $p$ and $q$.\nYou have $T$ test cases to solve.\n\n## Constra...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments