Chef and His Secret
All submissions for this problem are available.
Chef and his girlfriend talk over on the email. Chef wants only her to understand what he writes. For that, he wants to encrypt his messages so that she can only read it, while for others its just some words without any meaning.
So to achieve this, Chef comes up with a plan. He makes a algorithm that encrypts the messages. The idea was,
Replacing letters a to m with n to z
Replacing letters n to z with a to m
Replacing letters A to M with N to Z
Replacing letters N to Z with A to M
Also, replacing digits 0 to 4 with 5 to 9
and replacing digits 5 to 9 with 0 to 4
Note that spaces are left unchanged and case of the letter is taken in consideration.
You have to help Chef's girlfriend to decrypt his messages.
There will be an input n, denoting the number of strings.
From second line input will consists of n number of encrypted strings.
For each test case the output will be the decrypted string.
- 1 ≤ n ≤ 100
- Size of the message will be upto 50 characters.
- There will not be any consecutive spaces i.e. no consecutive two spaces.
- Letters from 'a' - 'z' , 'A' - 'Z'
- Digits from '0' - '9'
Input: 2 Uryyb28 NnOoPpQqRr AaBbCcDdEe Output: Hello73 AaBbCcDdEe NnOoPpQqRr
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, PAS fpc, NODEJS|
Fetching successful submissions