Encrypted School Name
InterviewTime limit1sMemory limit512 MB
Given an encrypted school name, find which of four schools it came from by trying all 26 possible shifts of its processed name.
- Level
Easy2 of 10
- Topics
- Implementation, Brute force, String
- Solved
- No attempts yet
Problem
GEC has several schools. The abbreviation and full name of each school are as follows.
- NLCS: North London Collegiate School
- BHA: Branksome Hall Asia
- KIS: Korea International School
- SJA: St. Johnsbury Academy
Dongho, who dislikes school names, encrypted the names of the schools.
Dongho encrypts a name as follows. The name being encrypted is the full name.
- Remove all spaces and punctuation from the name.
- Change every uppercase letter in the name to lowercase.
- Remove every letter except the first letters of the name.
- Choose an integer from to , then shift all letters of the name forward by positions.
Shifting letters forward by positions means repeating times the replacement of a with b, b with c, ..., y with z, and z with a. You want to know which school the encrypted name originally belonged to, but you do not know the that Dongho chose.
Input
The first line contains the encrypted school name. Every input is generated by the process described above.
Output
On the first line, print NLCS if the encrypted name belongs to NLCS, BHA if it belongs to BHA, KIS if it belongs to KIS, and SJA if it belongs to SJA.