Aman and Chocolates

2.5

4 votes
Problem

Aman and his friend Ankit are in a bet. Ankit asks Aman to give the no of zeros in the factorial of a number and if Aman answers correctly, he would get chocolates equal to the number of zeros in the of the factorial of the number which Ankit stated. Ankit tries to fool Aman every time , so Aman asks you as his programmer friend to write a code that would help him not to be fooled by Ankit.

INPUT:

First line contains N= < 300 as the number of test cases.

Next N lines contain a number 5 < = M < = 10^6

OUTPUT:

N Lines containing no of zeros in the factorial of each test case.

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

5! = 120 , so 1 Zero 7!=5040, So 2 Zeros 6!=720, so 1 Zero 12!=479001600, so 4 Zeros

Editor Image

?