Big Number
Time limit2sMemory limit128 MB
For each m up to 10^7, print the number of decimal digits in m factorial.
- Level
Easy3 of 10
- Topics
- Math, Number theory, Prefix sum
- Solved
- No attempts yet
Problem
Many applications work with very large numbers. Such applications use large numbers as keys in order to transmit and encrypt data securely.
Given an integer , write a program that computes how many digits (m factorial) has, where .
Input
The first line contains the number of test cases. Each of the following lines contains one integer . ()
Output
For each test case, print the number of digits of (its length in base 10) on its own line.