Programming contests

DEIK Regionális Programozó Csapatverseny, gyakorló feladatsor

October 26, 2012 8:00 PM – November 23, 2012 12:00 AM

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

  1. 3 3 3
  2. 2 3 4
  3. 0 0 0
download as text file

Output for Sample Input

  1. Case 1:
  2. *********************
  3. *********************
  4. *********************
  5. ***...***...***...***
  6. ***...***...***...***
  7. ***...***...***...***
  8. *********************
  9. *********************
  10. *********************
  11. ***...***...***...***
  12. ***...***...***...***
  13. ***...***...***...***
  14. *********************
  15. *********************
  16. *********************
  17. ***...***...***...***
  18. ***...***...***...***
  19. ***...***...***...***
  20. *********************
  21. *********************
  22. *********************
  23. Case 2:
  24. ***********************
  25. ***********************
  26. ***********************
  27. ***..***..***..***..***
  28. ***..***..***..***..***
  29. ***********************
  30. ***********************
  31. ***********************
  32. ***..***..***..***..***
  33. ***..***..***..***..***
  34. ***********************
  35. ***********************
  36. ***********************
  37. ***..***..***..***..***
  38. ***..***..***..***..***
  39. ***********************
  40. ***********************
  41. ***********************
  42. ***..***..***..***..***
  43. ***..***..***..***..***
  44. ***********************
  45. ***********************
  46. ***********************
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019