LENGFACT  Factorial length
Given integer n, print length of n! (which is factorial of n).
Input
The first line of the standard input contains one integer t (t < 10001) which is the number of test cases.
In each of the next t lines there is number n (0 <= n <= 5*10^9).
Output
For each test, print the length of n! (which is factorial of n).
Example
Input:
3
1
10
100
Output:
1
7
158
hide comments
prabodh prakash:
20170607 21:09:01
In Python, I used 22/7 for pi and was getting WA. then I used math.pi and got Accepted. 

nesbak:
20170531 13:29:00
i am getting wrong answer even after getting right answer on ideone for of the cases and i have kamenetskys formula only


rakcode1998:
20170411 12:34:34
Keep 0 in mind


nilabja16180:
20170313 17:32:21
use long long for input type of n, costed few WA! 

kass_97:
20161231 23:15:05
Simply formula based, AC in 0.02 

umohan:
20161208 22:33:43
consider 0 

sandeep_4141:
20161022 09:16:28
i use kamenertsky ...my code give correct ans to all testcase of spoj toolkit on ideone but i get WA on spoj.need help?? 

square1001:
20160802 04:42:49
Pay attention for test case which n is equal to 0. 

akshayjhamb2:
20160613 13:02:00
easy problem , u just need to know kamenetsky's formula 

nonushikhar:
20160311 21:25:07
worst qs shud be removed

Added by:  Piotr KÄ…kol 
Date:  20100119 
Time limit:  0.694s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  Copy of the problem: FACTLENG with different assessment 