Zeros in Factorial
All submissions for this problem are available.
Harry goes running to Hermoine. He’s been given a problem from Snape, in which given a number he has to tell the number of zeroes at the end of the number’s factorial. Being a veteran Code Champion, help Harry by writing a program for this task.
The first line of the input contains the number of strings(T) that Snape says.
Each test case consists of one line only, containing the number said by Snape.
Output should contain one line only for each test case, displaying the number of zeroes at the end of the factorial.
- 1 ≤ T ≤ 200
- 1 ≤ S ≤ 106
Sample Input: 2 5 100 Sample Output: 1 24
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.