Ryan wants to send a secret message to Malcolm. Faintly remembering a lesson on ciphers from 5th grade, Ryan decides he would make a Caesar Cipher. Wanting to find a faster way of encoding and decoding messages, Ryan decides to make a program to do it for him.
A Caesar Cipher is a simple substitution cipher; each letter of a given text is replaced by a letter some fixed number of positions down the alphabet. With a shift of 1, A would be replaced by B, B would become C, and so on.
A positive shift would signify a shift down the alphabet (
A), a negative shift; up the alphabet (
The first line of input will contain the integers ~N~, the length of the string to encode, and ~R~, the amount of shifts, seperated by a space.
The next line of input will contain the message to be encoded, a string with a length of ~N~. All letters are guaranteed to be uppercase.
Output the shifted string in uppercase. Non-letter characters should not be changed.
Subtask 1 [0%]
~1 \le N \le 10^3~
~-26 < R < 26~
Subtask 2 [80%]
~1 \le N \le 10^5~
~-10^5 \le R \le 10^5~
47 7 HEY MALCOLM! WANNA HANG OUT AFTER SCHOOL TODAY?
OLF THSJVST! DHUUH OHUN VBA HMALY ZJOVVS AVKHF?
A shift of 7 will look like this:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
A would turn into