N trailing zeroes in factorials
Submissions: 557   Accuracy:

26.2%

  Difficulty: Easy   Marks: 2

Given an integer n, we need to find the number of positive integers whose factorial ends with n zeros.

Input:

The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N.
Output:

For each testcase, Print the count of positive numbers whose factorial ends with n zeros.
Constraints:

1<=T<=100

1<=N<=1000
Example:

Input:

2

1

5

Output:

5

0

Explanation:

Testcase 1: Here, 5! = 120, 6! = 720,
7! = 5040, 8! = 40320 and 9! = 362880.

Testcase 2: No such number exists.

 

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

Contributor: Sahil Chhabra
Author: Sahil_Chhabra


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.