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:
*
*
*

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

*****
*****

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
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 ....
2018-09-04 17:54:12
Can be done using while and for loop easily. Just check individual conditions.
2018-08-22 08:29:16
Solved!

Last edit: 2018-08-22 08:29:49
2018-08-05 11:08:09
am getting wrong answer even after printing the right pattern. can anyone please help?
2018-05-20 09:55:50
hey guys
this problem is pretty simple answer lies within illustration
2018-04-21 04:37:28
cow and col bettwen 1 and n -2
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
2018-04-01 10:34:05
did not understand the pattern in the first place what the?
2018-01-02 08:26:41
give me that code

Last edit: 2018-01-02 08:28:27
2017-12-20 04:27:39
a good tricky
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.