Akaraka 2
Time limit1sMemory limit1024 MB
Given K, print the shortest string in which AKARAKA appears as a contiguous substring exactly K times.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Akaraka!
Akaraka (ara) ching akaraka (ara) cho akaraka (ara) ching ching
cho cho cho lalala sisbumba yonsei sonsu rapla
hey yonsei ya!
AKARAKA is, from a computer science point of view, a slogan that even Turing would give a standing ovation. AKARAKA is a palindrome by itself, and its prefix and suffix AKA is also a palindrome. A palindrome is a string that reads the same backward.
Hyeongjin wants to build a string that shows AKARAKA as many times as possible. Find the shortest string in which AKARAKA appears as a contiguous substring exactly times. It can be proven that such a string exists and is unique.
Input
The first line contains a positive integer .
Output
On the first line, print the shortest string whose length- contiguous substrings include AKARAKA exactly times.
Hint
A contiguous substring is a string obtained by deleting any number of characters from the start and the end of the original string. Deleting nothing from either end is also allowed.