# | Problem | Pass Rate (passed user / total user) |
---|---|---|
12009 | Caesar salad |
|
14414 | Fishhh's military career |
|
Description
Caesar wants to eat salad, but nobody sells salad within his country. Thus, he decides to write a letter to the businessmen outside his country. But to secure his message, he has to encrypt the content of his letter.
The encrypt rule is as follow: For each English character inside his letter, shift it with a fixed number n in positive/negative direction.
For example,
- n = 2, then "IJK" will become "KLM"
- n = 3, then "IJK" will become "LMN"
- n = -2, then "AJK" will become "YHI"
- We do the shifting in a cyclic manner, that is, perform left shift 1 on "A" will become "Z"; right shift 2 on "Y" will become "A"
Actually, this encryption is the well-known Caesar chiper.
Input
Input consists of three UPPERCASE English characters and an integer n, seperated by a whitespace character.
The three uppercase English characters is the Caesar's message, n is the shift amount mentioned above (positive for right shift, negative for left shift).
It is guaranteed that -2147483648 <= n <= 2147483647.
Output
Print Caesar's message after encryption (three UPPERCASE English character).
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Fishhh is about to join the military, and unfortunately, he has to serve one year of mandatory service. Upon receiving his draft notice, he got his recruit information, including a military branch represented by a single English letter C, and a 20-digit ID number. He's worried about reporting to the wrong place, so he needs your help to calculate the following information:
- Military Branch: Lowercase letter represents Navy, uppercase letter represents Army
- Battalion: The first 3 digits of the ID number
- Company: The 4th to 8th digits of the ID number
- Platoon: The 16th digit from the front of the ID number (5th from the end), where 1 represents A, 2 represents B, and so on
- Group: The remainder of the ID number divided by 4, plus 1
Input
The input consists of only one line, containing a character C and a string ID of length 20 composed of digits 0-9 (may have leading zeros), separated by a space.
Constraints
- C will only be an uppercase or lowercase English letter.
- The length of ID is 20. (May include leading zeros)
- for all i in [1,20], 0 ≤ idi ≤ 9
- id16 ≠ 0
Subtasks
- Testcases 1~3: ID has 11 leading zeros.
- Testcases 4~5: ID has 3 leading zeros.
- Testcases 6~10: No additional restrictions.
Output
The output consists of five lines, each containing a string or an integer, representing:
Military Branch (string), Battalion (integer), Company (integer), Platoon (string), and Group (integer).
"integer" means it doesn't include any unnecessary leading zeros.
Please remember to print "\n" at the end.