|
|||||||||||||||||||
|
SPOJ time: 2012-05-25 02:33:03 |
More CaterpillarsProblem code: HS11MCTP
As we mentioned previously, there are two types of caterpillars. Your new task is to print several caterpillars which are relaxing, lying on a square. InputFirst two integers: c, 1<=c<=100, denoting the number of caterpillars and n, 10<=n<=100 the size of the square. Each of the next lines consists of one letter (V, for vertical caterpillars or H for horizontal ones, an integer 3<=n<=20 - the caterpillar size in segments and two integers: x, y denoting the coordinates of the upper left corner of the given caterpillar. OutputThe nxn square and the caterpillars according to the description. Please consult the examples below. ExamplesExample 1 Input: 2 12 V5 1 1 H3 7 10 Output: ###......... ..#......... ###......... #........... ###......... ..#......... ###......... #........... ###......... ..#...#.###. ......#.#.#. ......###.## Example 2 Input: 4 14 H3 3 1 H3 4 4 V4 2 5 V3 8 7 Output: ..#.###....... ..#.#.#....... ..###.##...... ...#.###...... .###.#.#...... ...###.##..... .###...###.... .#.......#.... .###...###.... ...#...#...... .###...###.... .#.......#.... .............. .............. ScoringBy solving this problem you score 10 points.
|
||||||||||||||||||
| |||||||||||||||||||