Trailing Zeroes

3

26 votes
Problem

Let there be a function f(N) such that f(N) denotes number of zeroes at the end of N! (factorial of N).

For example, f(5) = 1 because 5! = 120.

You have to compute f(N) for given N.

Input format : Input begins with integer t ( 1<= t <= 10000) denoting number of test cases. Then there are t lines each containing exactly one positive integer 0< N <10000000

Output format : print f(N)

example:

input:

2

3

25

output:

0

6

Sample Input
5
4
5
10
25
100
Sample Output
0
1
2
6
24
Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?