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: import java.io.*;
	import java.util.*;



	class Main {

		public static long check(long x)
		{
			int count = 0;


			while(x > 0 )
			{
				long temp = x;
				while(temp >= 10)
					temp /= 10;

				x -= temp;

				count++;
			}


			return count;
		}

		public static long new_check(long x)
		{
			int count = 0;
			while(x >= 10 )
			{
				long temp_ans =1;
				long temp = x;

				while(temp >= 10)
				{
					temp /= 10;
					temp_ans *= 10;
				}

				temp_ans *= temp;

				if (x != temp_ans){

					long diff = x - temp_ans;

					if (diff >= temp)
					{
						temp_ans += diff - ((diff/temp)*temp);
						count += (diff/temp);
					}
					else
					{
						temp_ans = x;
						temp_ans -= temp;
						count++;
					}

				}
				else{
					temp_ans -= temp;
					count++;
				}


				x = temp_ans;

			}
			if (x > 0 && x < 10)
				count++;

			return count;
		}

		public static long calculate (long start,long end,long x)
		{
			if (start <= end )
			{
				long mid = (start+end)/2;

				long temp = new_check(mid);

				if (temp == x)
				{
					return mid;
				}
				else if (temp > x)
					return calculate(start,mid-1,x);
				else
					return calculate(mid+1,end,x);

			}
			return -1;
		}
		public static void main (String[] args) throws IOException {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

            int t = Integer.parseInt(reader.readLine());












			while(t-- > 0)
			{
				long n = Integer.parseInt(reader.readLine().trim());
				long x = n*10;

				long ans = calculate(n,x,n);

				while (n == new_check(ans+1))
					ans++;
				System.out.println(ans);




			}


		}
	}, In this Programming Language: Java, Now tell me if this Code is compilable or not?