MIR Cipher

면접 대비

시간 제한1초메모리 제한2048 MB

요약
i번째 글자를 2^(i-1)만큼 뒤로 밀어 원래 메시지를 복원하는 문제입니다.
난이도

쉬움10점 중 2점

유형
문자열, 수학, 구현
정답자
아직 제출이 없습니다

문제

Mines Internet Radio (MIR) has recently been intercepting some weird transmissions, and they believe it is some type of encoded message. They have figured out how the messages can be decoded, but are having a hard time doing it by hand with the quantity they have received, so they've tasked you with creating a program to decode the messages.

They've identified the following procedure for decoding the the message they received.

The first letter of the message is shifted by 11 letter, with shifts wrapping around to the beginning of the alphabet. This means that an A would become a B, a B would become a C, etc. with a Z wrapping around to become an A. Each subsequent letter in the message is shifted by twice the amount of the previous letter, with shifts wrapping around the alphabet as with the first letter. This means the second letter in the message is shifted by 22 letters, so an A becomes a C, a B becomes a D, etc. all the way down to Y which would become an A and Z which would become B. The third letter of the message is shifted by 44 letters in a similar manner, and so on for the rest of the letters in the message.

Note that the shift amount could be more than the number of letters in the alphabet in which case you need to wrap around the alphabet multiple times.

입력

You will be given one line of input consisting of two parts separated by a space:

  • An integer 1≤N≤601 \leq N \leq 60 representing the number of letters in the message to follow.
  • A string of length NN consisting of only uppercase letters in the English alphabet (A-Z).

출력

Output one line with the decoded string in all upper-case letters.

예제1

  1. 예제 1

    입력
    10 GCHDYQCTPL
    
    예상 출력
    HELLOWORLD