#C6057. Message Decoding
Message Decoding
Message Decoding
You are given an encoded message which has been transformed using a Caesar cipher, where each letter in the message is shifted backwards by n positions. Your task is to decode the message and recover the original text. The encoded message consists only of lowercase letters and spaces. The decryption should be done in such a way that if a letter is shifted before 'a', it wraps around to 'z' (i.e. use modulo 26 arithmetic).
For example, if n = 3 and the encoded message is def
, then the decoded message is abc
.
inputFormat
The input is read from standard input (stdin). The first line contains an integer T representing the number of test cases. For each test case, there are two lines: the first line contains an integer n (the number of positions each letter is rotated) and the second line contains the encoded message (a string of lowercase letters and spaces).
outputFormat
For each test case, output the decoded message on a new line, writing to standard output (stdout).## sample
5
3
def
1
bcd efg
1
a
0
hello world
25
zab
abc
abc def
z
hello world
abc
</p>