#T778. 数码统计
数码统计
Description
Little A has been reading a book recently, said to be The Classic Training Guide for Algorithm Competitions. He has been reading it for quite a few days. One day, he suddenly had a flash of inspiration, and his soul left his body, pondering a question:
Among all the book pages he has read so far, each page has a unique page number starting from 1. Now, he wants to know the total number of digits that have appeared across all the pages he has read.
For example: If he has read up to page 57, then from pages 1 to 57, there are a total of 103 digits.
Given the sheer thickness of this book, as a COIer, can you help him solve this problem programmatically?
Input Format
The first line contains a positive integer T (≤100), representing the number of test cases. Each subsequent line contains a positive integer n (≤10^9).
Output Format
For each test case, the output consists of two lines:
- The first line follows the format:
Case #:, where#is the test case number. - The second line contains a single integer, representing the result.
Example Input:
2
57
10
Example Output:
Case 1:
103
Case 2:
11
1
12
Case 1:
13
## Source
CodesOnline
The translation maintains the original markdown heading structure (## for level 2 heading) and preserves the content "CodesOnline" as-is since it appears to be a proper name/title. No additional formatting or code blocks were present in the source to preserve.