Question :
You have a positive number of length n and one additional digit.
You can insert this digit anywhere in the number, including at the beginning or at the end.
Your task is to make the result as large as possible.
For example, you have the number , and the additional digit is . Then the maximum number you can get is , and it can be obtained in two ways — by inserting a digit after the th or after the th digit of the number.
The first line contains a single integer t (
The first line of the description of each test case contains two integers and (; ) — the length of the number and an additional digit, respectively.
The second line of the description of each test case contains a string consisting of digits — the number that you have initially. It is guaranteed that the number does not contain leading zeros.
It is guaranteed that the sum of n for all test cases does not exceed
For each test case, output a string consisting of digits — the maximum possible number that can be obtained.
115 4765431 012 5443 66665 6135795 89753119 498765432101234567895 7737378 1200000007 0705895912 1828127127732
765443 10 544 6666 613579 987531 98765443210123456789 773737 210000000 70589590 8281271277321
Explanation :
Find the first digit less than d and insert d before it. If there's no such digit, insert at the end.