CPTTRN3 - Character Patterns (Act 3)

Using two characters: . (dot) and * (asterisk) print a grid-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 in the grid. Each square of the grid is of the same size and filled with 4 dots (see the example below).

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
2021-05-12 13:23:19
the logic for the number of lines and columns :
<snip>

[NG]: ... is for each to find on one's own.

Last edit: 2021-05-13 12:45:11
2020-06-17 07:03:49
in this no 3 is lucky use it and get AC!
2020-03-27 02:50:06
My hint is to use strings that include "\n". AC for the first time.
2019-08-15 05:32:52
simple problem... check the pattern carefully..!!
AC in one go...!!
2019-06-12 09:04:52
Very easy question.
2018-08-22 11:21:57
How to reduce the memory space? I always have 28M in python but some users reduce it to 9.8M. How?
2018-08-07 12:12:35
It's easy problem, I tried many times but at last i knew the trick, its a little math trick, take a deep lock into the pattern and you will guess it
2018-06-23 15:40:54
Use this simple logic to calculate the total number of lines and columns :
l = (l + 1) + ( l * 2 )
c = (c + 1) + (c * 2)
now apply the logic to add stars and dots
stars will be applied at first line and the lines which give 0 on mod 3, same is the case with columns
2017-12-27 13:26:03
O(1) solution for this problem reply me asap,thanks in advance
2017-10-03 11:23:30
I need help. I did the program and the output is correct each time I run the program. But my solution is not getting excepted.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.