|
||||||||||
Hex FactorialTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 858 Accepted Submission(s): 348 Problem Description The expression N!, reads as the factorial of N, denoting the product of the first N positive integers. If the factorial of N is written in hexadecimal without leading zeros, can you tell us how many zeros are there in it? Take 15! as an example, you should answer "3" because (15)10! = (13077775800)16, and there are 3 zeros in it. Input The input contains several cases. Each case has one line containing a non-negative decimal integer N (N ¡Ü 100). You need to count the zeros in N! in hexadecimal. A negative number terminates the input. Output For each non-negative integer N, output one line containing exactly one integer, indicating the number of zeros in N!. Sample Input
Sample Output
Source | ||||||||||
|