#K6941. Lexicographical String Shift
Lexicographical String Shift
Lexicographical String Shift
You are given an integer \(k\) and a string \(s\) consisting of lowercase English letters. Your task is to transform the string \(s\) by shifting each character \(k\) positions forward in the alphabet. The transformation wraps around the end of the alphabet. For example, if shifting \('z'\) by 1, it becomes \('a'\).
The transformation for a character \(c\) can be described by the following formula:
[ c' = \text{chr}(((\text{ord}(c)-\text{ord}('a')+k) \mod 26) + \text{ord}('a')) ]
You will be given multiple test cases. For each test case, apply the transformation and output the resulting string.
inputFormat
The first line of input contains an integer \(T\) (the number of test cases). Each of the following \(T\) lines contains an integer \(k\) and a string \(s\) separated by a space.
outputFormat
For each test case, output the transformed string on a new line.
## sample2
3 abc
1 xyz
def
yza
</p>