Skip to content

Latest commit

 

History

History

TrailingZerosInFactorialOfANumber

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Trailing Zeros Easy

Count the number of trailing 0s in factorial of a given number.

Input Format

First line of input contains T - number of test cases. Its followed by T lines, each containing an integer N.

Constraints

1 <= T <= 10000
1 <= N <= 1015

Output Format

For each test case, print the number of trailing 0s in N!, separated by new line.

Sample Input 0

3
2
5
20

Sample Output 0

0
1
4

Explanation 0

Self Explanatory

Ref Link

Trailing Zeros Easy