ECOO Practice 2014
Problem 1: Do You Want to Build a Snowman?
Anna is trying to get Elsa to come outside and play with her. She reminisces about the days where they used to build their childhood snowman named Olaf (who happens to love warm hugs). Unfortunately, Elsa is too stubborn to come out and play, so you will have to help Anna build Olaf yourself!
Olaf has three twigs on top of his head. He has two circular eyes, a carrot nose, and two arms made from sticks. The following is a depiction of Olaf:
| \ | / \ | / \|/ XXXXXXX X X X O O X X V X W X X X X \ X XXXXX X \ X X \ XXXXXXX \ X X--- X O X \ X X \ XXXXXXXXXXX \ X X M X O X X O X X X XXXXXXXXXXXXXXX OOOO OOOO OOOO OOOO
While Olaf is classically built with two torso sections (as shown in this example), Anna is bored, and would like to build Olaf with N (1 ≤ N ≤ 10) torso sections. The topmost torso section is 7 characters wide at the top, and tapers down to being 11 characters wide at the bottom. In order for the snowman to be balanced when it's standing, the torsos must get larger as they get closer to the ground. Specifically, each torso section should be taller by a total of 1 character than the one above it, and width of the top of each torso section should be equal to the width of the bottom of the torso section above it. Furthermore, the number of buttons on each torso will grow by 1 each time. There will be two feet at the bottom of Olaf, each 2 rows by 4 columns, separated by a vertical gap, and horizontally centered relative to Olaf's body.
The input will contain 5 test cases, one line per test case. Each line will contain the integer N, the number of torsos that you should give to Olaf.
For each test case, you should output Olaf with the specified amount of torsos. Every other aspect except of Olaf for the torsos should be exactly the same as the diagram above (e.g. the position of his eyes/nose/smile, the number of slashes for the arms and hair, etc.). The output should not contain any trailing spaces, and all letters in the output should be capitals. Separate the test cases by an empty line. The first line of output should not be blank.
Sample Input (only 2 examples shown here)
| \ | / \ | / \|/ XXXXXXX X X X O O X X V X W X X X X \ X XXXXX X \ X X \ XXXXXXX \ X X--- X O X \ X X \ XXXXXXXXXXX \ OOOO OOOO M OOOO OOOO | \ | / \ | / \|/ XXXXXXX X X X O O X X V X W X X X X \ X XXXXX X \ X X \ XXXXXXX \ X X--- X O X \ X X \ XXXXXXXXXXX \ X X M X O X X O X X X XXXXXXXXXXXXXXX X X X O X X O X X O X X X XXXXXXXXXXXXXXXXXXXXX OOOO OOOO OOOO OOOO
Point Value: 7
Time Limit: 5.00s
Memory Limit: 16M
Added: Jun 29, 2014
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3