Under construction

Still being built. Things may change

Big Number

Time limit2sMemory limit128 MB

Summary
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 mm, write a program that computes how many digits m!m! (m factorial) has, where m!=1×2×⋯×mm! = 1 \times 2 \times \cdots \times m.

Input

The first line contains the number of test cases. Each of the following lines contains one integer mm. (1≤m≤1071 \le m \le 10^7)

Output

For each test case, print the number of digits of m!m! (its length in base 10) on its own line.

Examples1

  1. Example 1

    Input
    2
    10
    20
    
    Expected output
    7
    19