#K7226. Caesar Cipher Right Rotation
Caesar Cipher Right Rotation
Caesar Cipher Right Rotation
You are given an integer ( n ) and a string ( s ). Your task is to perform a right rotation (similar to a Caesar Cipher shift) on the string ( s ) by ( n ) positions. In other words, the last ( n ) characters of ( s ) become the first ( n ) characters of the result, and the remaining characters follow. Note that if ( n ) is greater than the length of ( s ), you should rotate by ( n \mod |s| ) positions. For example, if ( n = 3 ) and ( s = \texttt{'abcdef'} ), then the result is ( \texttt{'defabc'} ).
inputFormat
The input is read from standard input (stdin). The first line contains an integer ( n ) indicating the number of positions to rotate the string. The second line contains the string ( s ).
outputFormat
Output the rotated string to standard output (stdout).## sample
3
abcdef
defabc