For this Question: A boy lost the password of his super locker. He remembers the number of digits N as well as the sum S of all the digits of his password. He know that his password is the largest number of N digits that can be possible with given sum S. As he is busy doing his homework, help him retrieving his password.The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains two space separated integers N and S, where N is the number of digits in password and S is the sum of all the digits of the password.

Constraints:
1 <= T <= 100
1 <= N <= 10^4
0 <= S <= 10^6Corresponding to each test case, in a new line, print the largest integer if possible , else print -1.
The number should not have any leading zeroes

Note: Since the numbers can be very large, you have to print the answer in String formatInput:
3
5 12
3 29
3 26

Output:
93000
-1
998

Explanation :
Testcase 1: Sum of elements is 12. Largest possible 5 digit number is 93000.
Testcase 2: There is no such three digit number whose sum is 29., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		byte testCases = sc.nextByte();

		while(testCases-- > 0) {
			int digits = sc.nextInt();
			int digitSum = sc.nextInt();

			System.out.println(getLNWGS(digits, digitSum));
		}
	}

	public static String getLNWGS(int digits, int digitSum) {
		int maxDigit = 9;

		if(digitSum > maxDigit * digits) {
			return "-1";
		}

		if(digitSum < maxDigit) maxDigit = digitSum;

		char[] result = new char[digits];
		int i = 0;
		while(digitSum > 0) {
			result[i++] = (char) (maxDigit + '0');
			digits -= 1;
			digitSum -= maxDigit;
			if(digitSum < maxDigit) maxDigit = digitSum;
		}

		while(digits-- > 0) {
			result[i++] = '0';
		}

		return String.valueOf(result);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?