CPTTRN2 - Character Patterns (Act 2)

Using two characters: . (dot) and * (asterisk) print a frame-like pattern.


You are given t - the number of test cases and for each of the test cases two positive integers: l - the number of lines and c - the number of columns of a frame.


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
4 4
2 5




hide comments
nithin1997: 2020-01-14 07:43:27

Got the output for the given test case but the hidden test case is failing, can anyone help me.

Last edit: 2020-01-14 10:59:15
nagaraj_hwp: 2019-12-30 08:31:54

Even counted the spaces and did the exact output for that, still Run time error

anhduc2641999: 2019-12-23 09:47:00

Last edit: 2019-12-23 09:49:05
vaibs101: 2019-05-28 17:28:28

My output matches with expected output but also then it is giving an error due to hidden outputs please help!

Last edit: 2019-05-28 17:29:38
kkartik: 2019-03-13 19:57:23

my solution gives the desired output yet it shows it's wrong answer,why?

manoj228: 2018-11-04 15:45:00

i got the answer, Prakash.
:) Our team works makes great.

prakash209: 2018-11-04 15:25:18

I got the same expected ans.. but it shows wrong ans..
whats the problem ??? in this problem , condition for each value it give different result .. so how to we know the except value they given ....

suyashsingh234: 2018-09-04 17:54:12

Can be done using while and for loop easily. Just check individual conditions.

abhishektandon: 2018-08-22 08:29:16


Last edit: 2018-08-22 08:29:49
codesandblues: 2018-08-05 11:08:09

am getting wrong answer even after printing the right pattern. can anyone please help?

Added by:kuszi
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64