#C2139. Books' Last Pages Digit Count
Books' Last Pages Digit Count
Books' Last Pages Digit Count
Alice owns a collection of books. The i-th book has exactly \(i\) pages. She is curious about how many digits are required to write down the last page number for each of her books. For instance, if there are 10 books, their last page numbers are \(1, 2, \dots, 10\), and the total number of digits needed is 11.
Your task is to compute the total number of digits used when writing the last page number of every book from 1 to \(N\). You need to process multiple test cases. For each test case, you will be given a single integer \(N\) and must output the corresponding total digit count.
inputFormat
The input is read from stdin and consists of:
- An integer \(T\) representing the number of test cases.
- For each test case, a single line with an integer \(N\) indicating the number of books.
outputFormat
For each test case, output on a separate line the total number of digits required to write down the last page numbers of books from 1 to \(N\). The output should be written to stdout.
## sample2
5
10
5
11
</p>