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
tambot: 2016-01-05 23:35:36

@kuszi, could you please show the expected output for the following input?
5
3 1
5 5
10 10
15 14
30 31

miki_24: 2015-11-21 08:41:15

get WA, but my Output is:
4
3 1
4 4
2 5
3 8
*
*
*

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

*****
*****

********
*......*
********
What's wrong ?

sanyameep: 2015-11-15 07:49:12

Even after the 2 line breaks and exactly the same output as the expected output, I get wrong answer as the result. Why so?

bhargav431997: 2015-10-25 09:31:39

expected op
*
*
*

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


*****
*****


my op
*
*
*

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


*****
*****


exactly same as expected and also i added loop for '\n' in c what is mistake now?

ravikumargrk: 2015-10-24 19:29:59


Last edit: 2015-10-24 19:38:51
kuszi: 2015-10-17 22:38:21

@akay97, @This is correct, you get the "wrong answer" is for the hidden test case (sorry for the font colors not appropriate for the default colors of the new SPOJ design).

akay97: 2015-10-17 20:15:34

my problem is same as gurkang...
please resolve it asap
thanku

akay97: 2015-10-17 20:13:24

*
*
*
****
*..*
*..*
****
*****
*****
is this output correct??

gurkang: 2015-10-15 21:08:41

This is kind of stupid.
My output:
*
*
*

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

*****
*****
__________
expected output:
*
*
*

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


*****
*****
________

I have one less line break in between "4 4" and "2 5" than the expected output. I also have one extra line break after the lest "2 5" output. This hasn't been an issue on previous character pattern problems.

gupta833: 2015-10-06 19:21:21

Every time the compiler is saying "Wrong Answer".
http://www.spoj.com/error/15305105
Please help me, where is my answer wrong..?


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