Submit | All submissions | Best solutions | Back to list |
CPTTRN4 - Character Patterns (Act 4) |
Using two characters: . (dot) and * (asterisk) print a grid-like pattern.
Input
You are given t - the number of test cases and for each of the test cases four positive integers: l - the number of lines, c - the number of columns in the grid; h and w - the high and the width of the single rectangle.
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 1 4 4 1 2 2 5 2 2 Output: *** *.* *.* *** *.* *.* *** *.* *.* *** ************* *..*..*..*..* ************* *..*..*..*..* ************* *..*..*..*..* ************* *..*..*..*..* ************* **************** *..*..*..*..*..* *..*..*..*..*..* **************** *..*..*..*..*..* *..*..*..*..*..* ****************
Added by: | kuszi |
Date: | 2012-09-03 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
|
|||||
2020-04-12 01:52:08
AC in the first go!! it made a novice programmer like me feels happy. |
|||||
2020-01-21 13:12:00
noicee |
|||||
2019-12-21 08:59:21
got stuck |
|||||
2019-02-09 12:48:57
I have got solution accepted yet it shows edit or ideone it.what is the reason behind this Last edit: 2019-02-09 12:49:37 |
|||||
2017-12-26 12:57:35
This is the general case for making grids...good question...had fun...AC in one go Hint: first try to find the formula for grid then see where you have to put * and put condition for that otherwise it will print . |
|||||
2017-12-26 12:57:34
This is the general case for making grids...good question...had fun...AC in one go Hint: first try to find the formula for grid then see where you have to put * and put condition for that otherwise it will print . |
|||||
2017-11-24 11:44:25 dsr
Yay! AC in one go! :) |
|||||
2016-06-19 05:59:20
AC!! in first go :) |
|||||
2016-04-18 07:26:39
My code works perfectly fine with the above give test cases. But I keep getting wrong answer when I submit it. Edit: 18-04-16: Never mind I found my mistake. Nice problem admin! Last edit: 2016-04-18 07:30:25 |
|||||
2015-10-27 18:19:47
Great excercise for a novice programmer like me.I kept getting TLE so i optimized it as much as i could to then found out i was submitting it as python 3.4(3.4) instead of python 3(3.4). Atleast i learned alot about TLE this way. |