You are given a string \(S\) which consists of lower case Latin letters and you need to perform the following operation exactly \(K\) times:
- Select any character and replace it with its next character ['a' with 'b', 'b' with 'c'.... 'z' with 'a'].
You need to find the lexicographically smallest string after performing exactly \(K\) operations on string \(S\).
Input format
- The first line contains an integer \(T\) denoting the number of test cases.
- The first line of each test case contains two space-separated integers \(N\) and \(K\) denoting the length of string \(S\) and the number of operations to be performed respectively.
- The second line of each test case contains string \(S\) consisting of lower case Latin letters.
Output format
Print \(T\) lines. For each test case, print a single lexicographic string \(S\) after performing exactly \(K\) operations.
Constraints
\(1 \leq T \leq 20000\)
\(1 \leq N \leq 200000\)
\(1 \leq K \leq 1e9\)
String \(S\) consists of lower case Latin letters
Sum of \(N\) over all test cases will not exceed 200000
- We have 3 operations in first case so following transistion will take place x->y->z->a
- We have 3 operations in second case:
- First character z->a (1 operation)
- Second character y->z->a (2 operations)
We can not have any lexicographically smaller strings then the above obtained.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor