Scared of WhatsApp Policy

0

0 votes
Problem

Sambhav and Bakshi are best friends and chat with each other most of the time. But because of the new privacy policy of WhatsApp both of them are worried about their privacy of their messages.So they decided to encrypt their messages with a key, K, such that the character of their messages are now shifted K times towards right of their initial value in circular way ,i.e, A after Z, a after z and 0 after 9. But there is a fault in their technique i.e, it can only convert numbers and alphabets while leaving special characters as it is.

Because of this fault Mark was able to get the value K  required to encrypt the messages using their idea of encryption.So, can you help Mark in encriptying the message.

INPUT FORMAT

The first line of the input contains, T, the number of messages. The next line contains N, and K, no of characters in the message and key for encryption. The next line contains the message.

OUTPUT FORMAT

Output the encrypted messages on a new line for all the test cases.

CONSTRAINS

1T100

1N106

0K106

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

For the first test case, the message is "Hello-World!". Shifting "H" towards right by 4 we get "L", similarly sifting "ello" by 4 each we would get "ipps". Now since "-" is a special character we do not need to encrypt this character. After that we have "W" shifting "W" by 4 we come at "A", simlilarly shifting "orld" by 4 each we get "svph" and the last character is again a special character "!" so we do not encrypt this character.

For the second test case, we have "Aarambh@1800-hrs" we shift "A" by 50 which brings us to "Y" after 1 full circular rotation, the next character of the message is "a" which will be encrypted to "y", similarly "rambh" is encrypted in the same manner giving us "pykz". The next character is a special character "@", after that we have "1", shifting "1" by 50 we get "1" itself and similarly encrypting "800" gives us "800". The next character is again a special character "-", after which we have "hrs" which on encrypting will give is "fpq".

Editor Image

?