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
2023-09-09 22:12:35
Everyone can see my answer : <snip>
[Simes]: no thanks

Last edit: 2023-09-10 09:57:57
2021-10-09 17:33:51
@lastcomrade Thanks for your advice!
2021-06-29 17:45:07
not only print the pattern but also look for the spaces after each pattern successfully being printed.
2020-09-29 02:43:58
To those who are getting a WA on some hidden test case... My advice to you is to think of a test case when we have only 1 line and only 1 column and thus design your solution keeping that in mind. Also, a little tip try to use string or character arrays for the following lines and just print accordingly on the basis of the number of the line you are iterating on currently. Hope this helps. Cheers!
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
2019-12-30 08:31:54
Even counted the spaces and did the exact output for that, still Run time error
2019-12-23 09:47:00


Last edit: 2019-12-23 09:49:05
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
2019-03-13 19:57:23
my solution gives the desired output yet it shows it's wrong answer,why?
2018-11-04 15:45:00
i got the answer, Prakash.
:) Our team works makes great.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.