


The first line of input contains an integer 'T' representing the number of test cases.
The first line of each test case contains two space-separated integers ‘N’ and ‘K’.
For each test case, print the smallest ‘N’ digit number as a string whose sum of digits equals ‘K’. If no such number exists then you need to print “-1”, without quotes.
The output of each test case will be printed in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 5
1 <= N <= 5000
0 <= K <= 10^6
Where ‘T’ is the number of test cases, ‘N’ is the total number of digits and ‘K’ denotes sum of digits that the required number should have.
Time Limit : 1sec
The idea here is to fill the digits greedily. The first digit should be 1 then we will try to maximize the digits having zero. So, we will fill all back digits of the number using digit 9 and first digit with 1. Also, we will fill the remaining digits with 0.
Algorithm: