Total digits
Submissions: 550   Accuracy:

47.09%

  Difficulty: Basic   Marks: 1

Given a number n, count the total number of digits required to write all numbers from 1 to n.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n.

Output:
For each testcase, in a new line, print the total number of digits required to write all numbers from 1 to n.

Constraints:
1<=T<=105
1<=n<=105

Example:
Input:

2
13
4

Output:
17
4

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil
Author: Ayush Govil 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.