Logo
(追記) (追記ここまで)

31169번 - Hidden Password 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 1024 MB133937571.429%

문제

After a successful internship, Bytholomew was hired as a senior cyber-security expert. To lead by example, he decided to finally heed his own advice and use two different passwords for his e-mail and for the Facepalm social media. Unfortunately, remembering two passwords proved too much for him. Moreover, he couldn't just plainly write the passwords somewhere, as it would be against another of his recommendations. But being a security expert, Bytholomew knew exactly what to do. He chose his favorite integer $d > 0$ and wrote both passwords encoded with Caesar cipher with key $d$.

Pleased with his work, he looked at his notes and the horrible truth dawned on him: after the encoding, the first (e-mail) password became literally the second (Facepalm) password, while the second one turned into the first one. ,,Holy moly!" -- Bytholomew exclaimed, as there was nothing more to say.

Now you too can become a security expert -- knowing the first of Bytholomew's passwords, guess the second one, if possible.

입력

The first line of input contains the number of test cases $z$ (1ドル \leq z \leq 20$). The descriptions of the test cases follow.

Each test case is one word -- the password -- consisting of lowercase English letters, in a separate line. The password has at least 1ドル$ character and at most 200ドル,000円$ characters.

The total number of characters in all passwords does not exceed 1ドル,000円,000円$.

출력

For every given password, guess and output the second one in a separate line. If the second password cannot be determined (either because there is no solution or because there is more than one), output a single word NIE instead.

제한

예제 입력 1

1
cnffjbeq

예제 출력 1

password

노트

The Caesar cipher means substituting each letter with the one $d$ places down the alphabet, treating alphabet as cyclic if necessary. E.g. for $d = 3$ the letter a is substituted by d, b by e,...., w changes into z, x to a, y to b and z to c.

출처

Contest > Open Cup > 2021/2022 Season > Stage 8: Grand Prix of Poland H번

ICPC > Regionals > Europe > Central European Regional Contest > Poland Collegiate Programming Contest > AMPPZ 2021 H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /