Special Factorial Number
Submissions: 1818   Accuracy:

14.39%

  Difficulty: Easy   Marks: 2

Given a number x, the task is to find first natural number i whose factorial is divisible by x.

Input:

The first line of input contains an integer T denoting the no of test cases. Then T test case follows. Each test case contains only a single line containing the integer X.
Output:

For each test case output a single a line containing the first natural number whose factorial is divisible by X.
Constraints:

1<=T<=100
1<=X<=100

Example:

Input:
3
16
5
25

Output:
6
5
10

** For More Input/Output Examples Use 'Expected Output' option **

Author: harshitsidhwa


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.