Given a number x, the task is to find first natural number i whose factorial is divisible by x.
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.
For each test case output a single a line containing the first natural number whose factorial is divisible by X.
1 <= T <= 100
1 <= X <= 1000
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.