Trident
Time limit1sMemory limit128 MB
Print an ASCII trident with t tine rows, a crossbar, and h handle rows, using spacing s between the tines.
- Level
Easy2 of 10
- Topics
- Implementation, String, Simulation, Brute force
- Solved
- No attempts yet
Problem
A trident is a fork with three tines (prongs). A simple picture of a trident can be drawn using only asterisks (*) and spaces:
* * *
* * *
* * *
*******
*
*
*
*
In this picture each tine is a vertical column of 3 asterisks, and consecutive tines are separated by 2 spaces. The handle is a vertical column of 4 asterisks below the middle tine.
By changing three values , , and you can draw tridents of different shapes: is the height of the tines, is the spacing between tines, and is the length of the handle. The picture above corresponds to , , and .
Write a program that prints the trident described by , , and .
Input
Three integers , , and are given, one per line, in this order. Each of the three values is between 0 and 10, inclusive.
Output
Print the trident described by , , and . From top to bottom it consists of tine rows, a single crossbar row that joins the tines, and handle rows.
- A tine row: 3 asterisks, each adjacent pair separated by spaces.
- The crossbar row: asterisks.
- A handle row: spaces followed by a single asterisk (below the middle tine).
Do not print any trailing spaces after the last asterisk on a line.