Factorial and Multiple

AtCoder
IDabc280_d
Time2000ms
Memory256MB
Difficulty
You are given an integer $K$ greater than or equal to $2$. Find the minimum positive integer $N$ such that $N!$ is a multiple of $K$. Here, $N!$ denotes the factorial of $N$. Under the Constraints of this problem, we can prove that such an $N$ always exists. ## Constraints * $2\leq K\leq 10^{12}$ * $K$ is an integer. ## Input The input is given from Standard Input in the following format: $K$ [samples]
Samples
Input #1
30
Output #1
5

*   $1!=1$
*   $2!=2\times 1=2$
*   $3!=3\times 2\times 1=6$
*   $4!=4\times 3\times 2\times 1=24$
*   $5!=5\times 4\times 3\times 2\times 1=120$

Therefore, $5$ is the minimum positive integer $N$ such that $N!$ is a multiple of $30$. Thus, $5$ should be printed.
Input #2
123456789011
Output #2
123456789011
Input #3
280
Output #3
7
API Response (JSON)
{
  "problem": {
    "name": "Factorial and Multiple",
    "description": {
      "content": "You are given an integer $K$ greater than or equal to $2$.   Find the minimum positive integer $N$ such that $N!$ is a multiple of $K$. Here, $N!$ denotes the factorial of $N$. Under the Constraints o",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc280_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given an integer $K$ greater than or equal to $2$.  \nFind the minimum positive integer $N$ such that $N!$ is a multiple of $K$.\nHere, $N!$ denotes the factorial of $N$. Under the Constraints o...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments