All submissions for this problem are available.
Little Chef is learning differentiation and is amazed by the function ex as it stays the same even after differentiation.
Just for fun, he tries to find out how large is the value of ex. He is able to see only 10 digits in his calculator so he wants you to answer his endless list of queries for different values of x.
For each positive integer X that Little Chef gives you, you need to calculate the number of digits before the decimal point in eX.
The first line contains an integer T, denoting the number of test cases.
In the next T lines, each line has exactly one positive integer X
Output should contain T lines. Print the answer for each X in a separate line.
- 1 <= T <= 105
- 0 <= X <= 109
Input 3 1 10 101 Output 1 5 44
Test case 1:
The value of e1 = 2.71828... There is only 1 digit before the decimal point.
Test case 2:
The value of e10 = 22026.4658... There are 5 digits before the decimal point.
|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, SCALA, 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, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.