#K33217. Alphabetic Shift Encryption
Alphabetic Shift Encryption
Alphabetic Shift Encryption
You are given an integer \( R \) and a string \( M \) consisting of uppercase English letters. Your task is to encrypt the message by shifting each letter in \( M \) by \( R \) positions forward in the alphabet. The shifting should wrap around at the end of the alphabet (i.e., after \( Z \) comes \( A \)).
For example, if \( R = 1 \) and \( M = "ABC" \), then each letter is shifted one place to produce "BCD". Similarly, if \( R = 2 \) and \( M = "XYZ" \), the output should be "ZAB".
The mathematical operation for shifting a letter \( c \) can be written in \( \LaTeX \) as follows:
\[ \text{shift}(c) = \left( (c - A + R) \mod 26 \right) + A \]inputFormat
The first line of the input contains an integer \( T \), representing the number of test cases.
Each of the next \( T \) lines contains a test case with an integer \( R \) and a string \( M \) separated by a space.
outputFormat
For each test case, output the encrypted string on a new line.
## sample3
1 ABC
2 XYZ
26 HELLO
BCD
ZAB
HELLO
</p>