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
2015-09-10 10:00:08 prasad pawar
@kosi_mazaki : 2 line breaks between "4 4" & "2 5" frame doesn't give any error. Please check your solution for second test case.
2015-09-08 23:32:52
In the example above, there are 2 line breaks between "4 4" frame and "2 5" frame. The test cannot pass because of that.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.