Public submissions
Source code of every submission to this problem in this contest will be visible for everyone since 2013-11-30 15:56:27.

SPTTRN3 - Straight Line Spiral Pattern (Act 3)

Print a straight line spiral pattern as shown in the example below. Please use the * (asterisk) and . (dot) characters.

Input

You are given t - the number of test cases and for each of the test cases one integer: s, 3<s<100 - the size of the shape.

Output

For each of the test cases output the requested pattern. Use one line break in between successive patterns.

Example

Input:
5
4
5
11 
13
78

Output:
****
...*
*..*
****

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

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

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

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

Added by:kuszi
Date:2013-11-02
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Public source code since: 2013-11-30 15:56:27

hide comments
2014-12-09 19:24:19 PCGuyIV
My latest submissions fails even though it lines up with the test case examples flawlessly. At what point is it breaking down? Since I can't see the output of the tests the Cube runs, I can't determine where it's breaking down, and figure out what pattern to change to correct the issue.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.