Peter Pan Frame
Time limit1sMemory limit128 MB
Draw a 5-row banner where each letter of a word sits in a diamond of '#' or '*' depending on its position, with overlapping frames resolved by priority.
- Level
Medium5 of 10
- Topics
- Simulation, String, Implementation
- Solved
- No attempts yet
Problem
A "Peter Pan frame" decorates one alphabet letter by placing it inside a diamond made of # characters. A "Wendy frame" has the same shape, but the diamond is made of * characters.
Given a word, decorate every letter whose 1-based position is a multiple of 3 with a Wendy frame. Decorate all other letters with a Peter Pan frame.
If a Wendy frame and a Peter Pan frame overlap, the Wendy frame's * takes priority over the Peter Pan frame's #.
Input
The first line contains a word consisting only of uppercase English letters. The word has length at most 15.
Output
Print exactly five lines: the given word decorated with the required frames.