#C10566. Message Encryption by Right Shift
Message Encryption by Right Shift
Message Encryption by Right Shift
You are given an integer \(k\) and a string message. Your task is to encrypt the message by shifting its characters to the right by \(k \bmod n\) positions, where \(n\) is the length of the message. In other words, the encrypted message is obtained by concatenating the last \(k \bmod n\) characters with the first \(n - (k \bmod n)\) characters.
For example, if message = "SECRET" and \(k=2\), then \(n=6\) and \(k \bmod 6=2\); thus, the result is "ET" + "SECR" = "ETSECR".
Note that if \(k \bmod n = 0\), the encrypted message remains the same as the original message.
inputFormat
The input is given via stdin in the following format:
- The first line contains a single integer \(k\), representing the number of positions to shift.
- The second line contains the string message to be encrypted. The string consists of uppercase English letters without spaces.
outputFormat
Output the encrypted message to stdout.
## sample2
SECRET
ETSECR