A university encrypts the names of examination papers before sending them to affiliated colleges. Each paper name is transformed using a secret integer key K, and the encrypted result serves as the password required to unlock the corresponding file.
The encryption process works as follows:
Start with the paper name P and an integer key K (which may be positive, negative, or zero).
Only lowercase English letters (a-z) are encrypted.
Every lowercase letter is shifted by K positions in the alphabet.
Uppercase letters, digits, spaces, and special characters remain unchanged.
The lowercase alphabet is considered circular:
'z', continue again from 'a'.'a', continue again from 'z'.Generate the encrypted string after applying the above transformation.
P, representing the paper name.K.Print the encrypted string.
1 ≤ |P| ≤ 50-50 ≤ K ≤ 50Operating Systems
-40
OlqjAting Systems
Only lowercase letters are shifted by -40 positions (equivalent to shifting by 12 positions backward modulo 26). Uppercase letters and spaces remain unchanged.
hello123!
5
mjqqt123!
xyz
4
bcd
Commonwealth Bank of Australia - CBA • Pending