Smallest factorial number
Submissions: 1300   Accuracy:

25.88%

  Difficulty: Easy   Marks: 2

Given a number n. The task is to find the smallest number whose factorial contains at least n trailing zeroes.

Examples:

Input : n = 1
Output : 5 
1!, 2!, 3!, 4! does not contain trailing zero.
5! = 120, which contains one trailing zero.

Input : n = 6
Output : 25
25! = 15511210043330985984000000

Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer n.

Output:
For each test case in a new line print the required output.

Constraints:
1<=T<=100
1<=n<=100

Example:
Input:

2
1
6
Output:
5
25

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

Author: Shubham Joshi 1


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.