Shaban loves divisibility by 9, he has a number x with $$$n$$$ digits and he wants to transform it to the maximum number that is divisible by 9 by performing exactly $$$k$$$ of the following operation:
Each operation consists of choosing any single digit of x and doing one of the following:
Shaban will do exactly $$$k$$$ operations to transform the initial number into a new $$$n$$$-digit number that satisfies two conditions:
The resulting number can have leading zeros. If it's impossible to create such a number, you should print -1.
Each test contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1 \le T \le 10^5$$$), The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10^5$$$, $$$0 \le k \le 10^7$$$), representing the number of digits in the number and the number of operations, respectively.
The second line of each test case contains a string of $$$n$$$ digits, representing the initial number. The string can have leading zeros.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$.
For each test case, print a single line containing the resulting $$$n$$$-digit number that is as large as possible and divisible by 9. If no such number can be formed within $$$k$$$ operations, print -1.
72 4701 232 3302 21810 16123456789011 53159914600410 1001356849840
90 -1 00 27 9234567810 71599146003 9999999999
First Test Case:
The maximum number you can obtain is $$$90$$$, and it is divisible by 9.
Second Test Case:
No matter how you change the digits, the number will never become divisible by 9. so the answer is $$$-1$$$.
Third Test Case:
Fourth Test Case: