#C6085. Taco Message Encoding
Taco Message Encoding
Taco Message Encoding
You are given a lowercase alphabetical string S and a list of shift values. The task is to encode the message by shifting each character in S by the corresponding integer in the shift list. The shift is cyclic, i.e., after z comes a. Formally, if a character c is shifted by s positions, its new character is given by:
\( c' = \text{chr}(((\text{ord}(c) - \text{ord}('a') + s) \mod 26) + \text{ord}('a')) \)
Process each test case independently.
inputFormat
The input is read from standard input (stdin) and is formatted as follows:
- An integer
T
representing the number of test cases. - For each test case:
- A line containing the string
S
, consisting of lowercase letters. - A line containing
n
space-separated integers representing the shift values. It is guaranteed that the number of integers equals the length ofS
.
- A line containing the string
outputFormat
For each test case, output the encoded message on a new line to standard output (stdout).
## sample1
abcdef
1 2 3 4 5 6
bdfhjl
</p>