P15320 [GeeksforGeeks] Factorial and numbers0905
普及
题目描述

Given a number num. You are tasked with finding the smallest number S, such that num is a factor of S! (S factorial).

Example 1:
Input: num = 6
Output: 3
Explanation: 3! = 6 and 6 is
divisible by 6.
Example 2:
Input: num = 800
Output: 10
Exaplantion: 10! = 3628800 and 3628800
is divisible by 800.

Your Task:
You don't need to read or print anyhting. Your task is to complete the function findFact() which takes num as input parameter and returns smallest number whose factorial is divisible by num.

Expected Space Complexity: O(sqrt(num))
Expected Space Compplexity: O(sqrt(num))

Constraints:
1 <= num <= 10^{12}

输入格式

见题面

输出格式

见题面

样例输入
num = 6
样例输出
3