[BOJ 11488] Nimionese
View as PDFNimions speak a funny form of language.</p>
Whichever word they are trying to say, from which ever language, it doesn’t quite come out the same. There are several rules for converting words, from any language, to nimionese.
For any word:
- All nimion words start with ‘hard’ consonants — [b, c, d, g, k, n, p, t], so you must replace each first letter with the nearest one (choose the option nearest to ‘A’ if there is a tie).
- “Each” becomes “Dach”.
- Any hard consonant in subsequent syllables after the first one is remarkably better if it is replaced with the same consonant as the one at the start of the word.
- “Hip-po” becomes “Gip-go”. </ul> </li>
- No word ends in a hard consonant. You must add an ‘ah’, ‘oh’ or ‘uh’ at the end, whichever is nearest, rounding toward ‘A’ in the case of a tie, to the last hard consonant in the word.
- “Dog” becomes “Dogah”
- “Hip” becomes “Gipoh”. </ul> </li> </ul> ## 입력 형식
The only line of input contains a sentence of between 1 and 50 words and up to 104 symbols, including single whitespace characters (‘ ’) between words and the dashes (‘-’) between each syllable.
Apart from dashes, the sentence will contain solely lower-and-upper-case Latin letters — and only the first letters of words can be upper-case.
출력 형식
Write to standard output the same sentence from the input, translated to nimionese. Remove any dashes before printing.</p>
It is guaranteed that the output will fit within 5 · 104 characters
예제 입력 1
I love ba-na-na예제 출력 1
Gah kove bababa예제 입력 2
Cat-a-pil-lar예제 출력 2
Catacillar예제 입력 3
Co-ding is the best예제 출력 3
Cociccah gs the bestuh예제 입력 4
I rock at co-lour-ing예제 출력 4
Gah pockoh btuh colouriccah
Comments