CPTTRN2 - Character Patterns (Act 2)


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

Input

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.

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

Output:
*
*
*

****
*..*
*..*
****

*****
*****

hide comments
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

Solved!

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?

knakul853: 2018-05-20 09:55:50

hey guys
this problem is pretty simple answer lies within illustration

taidev198: 2018-04-21 04:37:28

cow and col bettwen 1 and n -2

utkarshsingh: 2018-04-12 22:36:33

just print first and last rows and then arrange in between rows and columns

Last edit: 2018-04-12 22:41:45
flash22: 2018-04-01 10:34:05

did not understand the pattern in the first place what the?

abuki123: 2018-01-02 08:26:41

give me that code

Last edit: 2018-01-02 08:28:27
sl170040813: 2017-12-20 04:27:39

a good tricky


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