#P6265. Vincent's Rectangular Skyscraper
Vincent's Rectangular Skyscraper
Vincent's Rectangular Skyscraper
From your perspective, Vincent's skyscraper is a rectangle whose sides are parallel to the coordinate axes, with one side lying on the horizontal axis.
The horizontal axis in the output is represented by the character *
, the outline of the skyscraper is drawn with #
, and all other areas are filled with .
.
The left edge of the image must start with the skyscraper and the right edge must end with the skyscraper. Instead of merely computing the horizontal length, output the perimeter of the building's outline. Note that if the building has width \(w\) and height \(h\), its perimeter is \(2(w+h)\).
inputFormat
The input consists of two positive integers, (w) and (h), separated by spaces, where (w) is the width and (h) is the height of the skyscraper.
outputFormat
First, print the ASCII art of the skyscraper. The building is represented over (h) rows: for a building with width (w) and height (h), the first and last rows (i.e. the top and bottom boundaries) consist entirely of #
characters, and any interior rows (if (h > 2)) have a #
in the first and last columns with .
filling the middle. Then, print an extra row representing the horizontal axis with *
repeated (w) times. Finally, on a new line, output the perimeter of the building (which is (2(w+h))).
sample
3 2
###
10
</p>