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
code_play24: 2017-11-24 07:25:42

*****
*...*
*...*
*...*
*****
coded it right way. i dont know whats the problem, it is showing wrong answer.

jayarathinam: 2017-08-31 08:29:04

give the solution for the logic?

mesakh123: 2017-08-09 08:47:50

i have finished this problem with two conditional for every line
1.if it's the first character || the last character || the first line || the last line
it wil print out '*'
2.else just print out '.'
after print out the whole line ,print newline. and for each question needed to print a new line, the last problem doesn't need
anyone

racerjhon: 2017-07-17 08:50:34

you just have to make a photo frame pattern. Like for case : 5 5 (l=5 and c=5) the pattern would be:

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

pyrojathon: 2017-07-13 21:49:30

has anyone completed this question?

keshav72: 2017-06-06 12:14:20

What are the constraints on l and c?

blackgoku: 2017-06-04 17:06:40

test for case:
11

pruvi007: 2017-06-03 14:49:04

what would be the o/p of
5 5
will it be
*****
*..*
*..*
*..*
*****

skjlucky: 2017-05-27 06:35:07

what is the logic behind this prblm?

rjun_1: 2017-04-30 08:53:57

which algorithm it takes to solve ?


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