#C5625. Caesar Cipher Decoding
Caesar Cipher Decoding
Caesar Cipher Decoding
You are given an encoded message which has been transformed using the Caesar cipher. In this cipher, each letter of the plaintext is shifted by a fixed number of positions in the alphabet. The decoding process involves shifting each letter back by the given number.
The transformation can be mathematically described using the formula:
\( \text{decoded} = \left((\text{ord}(c) - \text{ord}('A') - \text{shift})\mod 26\right) + \text{ord}('A') \)
Your task is to implement a program that reads the encoded message and the shift value from standard input (stdin) and outputs the decoded message to standard output (stdout).
inputFormat
The input consists of two lines:
- The first line contains the encoded message, consisting of uppercase letters only (without spaces).
- The second line contains a non-negative integer representing the shift value.
Note that the cipher uses a modulo 26 operation to wrap around the alphabet.
outputFormat
Output the decoded message as a single line to standard output (stdout).
## sampleD
3
A
</p>