2015 Canadian Computing Competition, Stage 1

Problem J3: Rövarspråket

In Sweden, there is a simple child's game similar to Pig Latin called Rövarspråket (Robbers Language).

In the CCC version of Rövarspråket, every consonant is replaced by three letters, in the following order:

  • the consonant itself;
  • the vowel closest to the consonant in the alphabet (e.g., if the consonant is d, then the closest vowel is e), with the rule that if the consonant falls exactly between two vowels, then the vowel closer to the start of the alphabet will be chosen (e.g., if the consonant is c, then the closest vowel is a);
  • the next consonant in the alphabet following the original consonant (e.g., if the consonant is d, then the next consonant is f) except if the original consonant is z, in which case the next consonant is z as well.

Vowels in the word remain the same. (Vowels are a, e, i, o, u and all other letters are consonants.)

Write a program that translates a word from English into Rövarspråket.

Input

The input consists of one word entirely composed of lower-case letters. There will be at least one letter and no more than 30 letters in this word.

Output

Output the word as it would be translated into Rövarspråket on one line.

Sample Input 1

joy

Sample Output 1

jikoyuz

Sample Input 2

ham

Sample Output 2

hijamon

All Submissions
Best Solutions


Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Feb 21, 2015

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

So, Rövarspråket means Robber's "Laguage"?

ah yes, the common word typoe, derived from the term "typoegraphical error"

Test cases one up'd me with a CRLF. Please fix.

Fixed

please fix ccc16s1 while you're at it

http://wcipeg.com/problem/ccc15j2 is broken.

Alex says it was my fault. I put a band-aid on it but I'll fix it properly soon.