For this Question: Rahul wants to impress a girl named Tanu whom he loves very dearly. Rahul gets to know that Tanu is stuck on a programming problem. Help Rahul to solve the problem so that he can impress Tanu.
Here is the description of the problem:-
Choose an integer n and subtract the first digit of the number n from it i.e if n is 245 then subtract 2 from it making it 245-2 = 243.
Keep on doing this operation until the number becomes 0 (for eg. 25 requires 14 operations to reduce to 0)
You are given a number of operation limit X. You have to find the greatest integer such that you can reduce it to 0 using atmost X operations.The first line of input contains the number of test cases T. The next T line contains a single integer X denotes the number of operations.

Constraints:-
1 <= T <= 100
1 <= X <= 314329798For each test case in a new line print the maximum number that can be obtained by performing exactly X operations.Sample Input:-
3
2
20
29

Sample Output:-
10
45
100

Explanation:-
For test 2:- 45 is the largest number that will become 0 after exactly 20 operations., I have written this Solution Code: 
def countdig(m) : 
  
    if (m == 0) : 
        return 0
    else : 
        return 1 + countdig(m // 10) 
  
def countSteps(x) : 
      
    c = 0
    last = x 
  
    while (last) : 
  
        digits = countdig(last) 
  
        digits -= 1
  
        divisor = pow(10, digits) 
  
        first = last // divisor 
  
        lastnumber = first * divisor 
  
        skipped = (last - lastnumber) // first 
  
        skipped += 1
  
        c += skipped 
  
        last = last - (first * skipped) 
  
    return c
def fun(l,r,ans,x):
	#print(l,r,ans,"gjgufy")
	if(l>r):
		return ans
	m=(l+r)//2
	midans=countSteps(m)
	#print(m,midans)
	if(midans<=x):
		ans=max(ans,m)
	if(midans<=x):
		return fun(m+1,r,ans,x)
	else:
		return fun(l,m-1,ans,x)
for _ in range(int(input())):
	x=int(input())
	print(fun(0,9999999999,0,x)), In this Programming Language: Python, Now tell me if this Code is compilable or not?