This problem is a programming version of Problem 40 from projecteuler.net
An irrational decimal fraction is created by concatenating the positive integers:
It can be seen that the digit of the fractional part is 1.
If represents the digit of the fractional part, find the value of the following expression.
First line contains that denotes the number of test cases. This is followed by lines, each containing an integers.
Print the answer corresponding to the test case.
1 2 3 4 5 6 7