Draw Grid
It is very easy to draw grids with ASCII characters. For example, look at the picture
below. It shows a 4×4 grid, where each smallest square is of size 3 and the
thickness of drawing line is 2.
**********************
**********************
**...**...**...**...**
**...**...**...**...**
**...**...**...**...**
**********************
**********************
**...**...**...**...**
**...**...**...**...**
**...**...**...**...**
**********************
**********************
**...**...**...**...**
**...**...**...**...**
**...**...**...**...**
**********************
**********************
**...**...**...**...**
**...**...**...**...**
**...**...**...**...**
**********************
**********************
In this problem, your job is very simple: Given the size of the grid, the size of the
smallest square and the thickness of the drawing line, you will just have to draw the
grid.
Input Specification
The input contains at most 101 lines. Each line contains three integers
S, T and N
(0 < S, T, N < 21). Here S is the size of
the smallest squares, T is the thickness of the drawing line, and N
is the size of the grid. Input is terminated by a set where the value of S,
T, and N is zero. This set should not be processed.
Output Specification
For each set of input, first print the sequence number of the test case in the same
format as the sample output. In the next several lines, draw an
N×N sized grid where each smallest square is of size
S×S and the thickness of the drawing line is T. Print
a blank line after the output of each case. Note that line pixels are denoted with
“*” (asterisk) and blank pixels are denoted with “.” (dot).
Sample Input
3 3 3
2 3 4
0 0 0
download as text file
Output for Sample Input
Case 1:
*********************
*********************
*********************
***...***...***...***
***...***...***...***
***...***...***...***
*********************
*********************
*********************
***...***...***...***
***...***...***...***
***...***...***...***
*********************
*********************
*********************
***...***...***...***
***...***...***...***
***...***...***...***
*********************
*********************
*********************
Case 2:
***********************
***********************
***********************
***..***..***..***..***
***..***..***..***..***
***********************
***********************
***********************
***..***..***..***..***
***..***..***..***..***
***********************
***********************
***********************
***..***..***..***..***
***..***..***..***..***
***********************
***********************
***********************
***..***..***..***..***
***..***..***..***..***
***********************
***********************
***********************
download as text file