#K4786. Taco String Transformation
Taco String Transformation
Taco String Transformation
Problem Statement:
You are given an integer k and a string S consisting of lowercase English letters. Your task is to transform the string S by replacing each character with the k-th next character in the alphabet. The transformation should be performed in a cyclic manner such that after 'z' the alphabet wraps around to 'a'.
The transformation for each character Si is defined by the formula:
$$ S_i = \text{chr}\Bigl((\text{ord}(S_i) - \text{ord}('a') + k) \mod 26 + \text{ord}('a')\Bigr) $$
Given multiple test cases, output the transformed string for each one on a separate line.
inputFormat
Input Format:
- The first line contains a single integer T, denoting the number of test cases.
- Each of the next T lines contains an integer k and a string S separated by a space.
outputFormat
Output Format:
For each test case, output the transformed string on a new line.
## sample3
1 abcd
2 xyz
3 hello
bcde
zab
khoor
</p>