Simple Programming Problems

Public submissions
Source code of every submission to this problem in this contest will be visible for everyone since 2013-08-24 14:48:58.
Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

SPOJ Problem Set (cpttrn)

12185. Character Patterns (Act 5)

Problem code: CPTTRN5

Using two characters: . (dot) and * (asterisk) print a grid-like pattern. The grid will have l lines, c columns, and each square shaped element of the grid will have the height and width equal to s.

Moreover, each of the grid elements will have a diagonal. The diagonal of the first square in the first line of the grid is directed towards down and right corner - use the \ (backslash) character to print it; while the next diagonal will be directed towards upper right corner - use the / (slash) character to print it. Print the successive diagonals alternately (please consult the example below).


You are given t - the number of test cases and for each of the test case three positive integers: l - the number of lines, c - the number of columns in the grid and s - the size of the single square shaped element.


For each of the test cases output the requested pattern (please have a look at the example). Use one line break in between successive patterns.


3 1 2 
4 4 1 
2 5 2 




Added by:kuszi
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel Pentium G860 3GHz)
Public source code since: 2013-08-24 14:48:58

hide comments
2014-07-28 12:23:45 kuszi
@Benji - thank you, fixed.
2014-07-23 16:03:50 Benji
There is a typo in "input" section: "...single squere shaped" -> "single square shaped"

Last edit: 2014-07-23 16:04:22
2013-10-31 11:29:59 kuszi
@Kunal Khanna - thank you. You are right, there should be three values in the input, fixed.

Last edit: 2013-11-02 15:29:47
2013-10-29 18:52:10 Kunal Khanna
ques says each input will have 4 values.. test case shows 3???
© All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.