Submit | All submissions | Best solutions | Back to list |
CPTTRN7 - Character Patterns (Act 7) |
Print a regular grid pattern with diamond-like base elements. Use the \ (backslash) and the / (slash) characters to print diamonds and . (dots) to fill the rest of the space.
Input
You are given t - the number of test cases and for each of the test cases three positive integers: r - the number of rows, c - the number of columns in the grid and s - the size of each diamond.
Output
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.
Example
Input: 3 3 1 2 4 4 1 2 5 2 Output: ./\. /..\ \../ .\/. ./\. /..\ \../ .\/. ./\. /..\ \../ .\/. /\/\/\/\ \/\/\/\/ /\/\/\/\ \/\/\/\/ /\/\/\/\ \/\/\/\/ /\/\/\/\ \/\/\/\/ ./\../\../\../\../\. /..\/..\/..\/..\/..\ \../\../\../\../\../ .\/..\/..\/..\/..\/. ./\../\../\../\../\. /..\/..\/..\/..\/..\ \../\../\../\../\../ .\/..\/..\/..\/..\/.
Added by: | kuszi |
Date: | 2012-09-04 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
|
|||||
2016-09-11 21:04:09
i dont know the exact solution for this from where can i find it? |
|||||
2016-07-25 21:36:07
magic happens with (i+j) and abs values. |
|||||
2016-06-23 11:30:17
What does the size of diamond mean here? |
|||||
2016-06-13 20:55:59
There are 2 line breaks after pattern for 4 4 1. Is that correct output ? also, what is the correct output for 2 3 3 Last edit: 2016-06-13 21:10:41 |
|||||
2015-12-07 14:28:47
@Micha³ Krokocki thank you, AC :) |
|||||
2015-12-07 13:06:10 Micha³ Krokocki
@miki_24 no, you have to make it work for any size you get. |
|||||
2015-12-06 11:27:21
is 2 max size? |
|||||
2015-11-23 18:07:32 Micha³ Krokocki
When you divide this program in four functions first line, upper_lines, lower_lines, last_line problem becomes actually easy. Maybe even first and last are not necessary, but it worked for me. |