#B2083. Draw a Rectangle

    ID: 11165 Type: Default 1000ms 256MiB

Draw a Rectangle

Draw a Rectangle

Given four parameters \(a, b, c, f\), draw a rectangle accordingly.

The first two parameters \(a\) and \(b\) are integers representing the height and width of the rectangle, respectively. The third parameter \(c\) is a character used to fill the rectangle. The fourth parameter \(f\) is an integer that determines the rectangle type: if \(f = 0\) the rectangle must be hollow (only its border is drawn), otherwise it is a solid rectangle.

For hollow rectangles, if the height or width is 1 (or if the width is too small), the entire rectangle will be drawn as a border.

See the sample input and output for clarification.

inputFormat

The input consists of four parameters separated by whitespace:

  • a: an integer representing the height of the rectangle.
  • b: an integer representing the width of the rectangle.
  • c: a character used to draw the rectangle.
  • f: an integer; if 0, draw a hollow rectangle, otherwise draw a solid rectangle.

outputFormat

Output the rectangle according to the parameters. Each row of the rectangle should be printed on a new line.

sample

3 4 * 1
****

****

</p>