#K47487. Artwork Title Caesar Cipher Encryption

    ID: 28209 Type: Default 1000ms 256MiB

Artwork Title Caesar Cipher Encryption

Artwork Title Caesar Cipher Encryption

This problem requires you to implement a Caesar cipher encryption specifically designed for artwork titles. Given a text string representing an artwork title and an integer k representing the rotation, your task is to encrypt the title by rotating each alphabetical character by k positions. Characters that are not letters should remain unchanged and the case of the letters must be preserved.

The encryption for a letter c can be mathematically expressed as:

$$ E(c) = ((c - base + k) \mod 26) + base $$

where base is the ASCII code for 'a' if c is lowercase and 'A' if c is uppercase.

inputFormat

The input consists of two lines:

  • The first line contains an integer k indicating the number of positions to rotate the letters.
  • The second line contains the string title that represents the artwork title to be encrypted.

outputFormat

Output the encrypted title as a single line to stdout.

## sample
3
Hello Artwork
Khoor Duwzrun