


The sequence of natural numbers are integers that start from 1.
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then each test case follows.
The first and the only line of each test case contains an Integer ‘N’ denoting the Nth natural number to find in the new sequence of natural numbers.
For each test case, return the Nth natural number starting from 1 in the new sequence of natural numbers defined by a committee of mathematicians.
Output for each test case will be printed in a new line.
You do not need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= N <= 10^5
Time Limit: 1 sec
We need to start iterating from 1 and check for every integer. If an integer contains 9, then ignore that integer and move forward till we get our ‘N’th integer that doesn’t contain the digit 9.
Algorithm:
As every number changes to base 9 after the transformation of sequence of natural numbers, at every multiple of power of 10, we have some numbers containing 9, which we are removing. Hence due to 9 base, we need to iterate and divide the number with 9 till it reaches zero and multiply the multiply counter by 10 as 10 times more number will be removed as each multiply counter increases by 10 times.
[Note: Multiply counter is the power of 10, which increases itself by 10 times after each iteration. Because there are 10 times more integers that will contain the digit ‘9’ compared to the previous iteration and they need to be removed.]
Algorithm: