You are given an integer ‘N’. Your task is to print the following pattern for the ‘N’ number of rows.
For Example:Pattern for ‘N’ = 5:

‘N’ is always odd.
The first line of input contains ‘T’, denoting the number of test cases. Then each test case follows.
Each test case contains a single integer ‘N’, denoting the number given.
Output format :
For each test case print 'N' strings denoting the pattern.
1 <= ‘T’ <= 5
1 <= ‘N’ <= 600
Time limit = 1 sec.
2
5
1
*
***
*****
***
*
*
For test case 1:
The pattern for ‘N’ = 5, will be as given above.
For test case 2:
The pattern for ‘N’ = 1, will be as given above.
3
7
*
***
*
*
***
*****
*******
*****
***
*
Try to divide problems into the upper half and lower half.
The main idea is to divide the pattern into two halves, the upper half and the lower half, and print them separately.
The steps are as follows:
O(N ^ 2), where ‘N’ is the number given.
Since we are doing N ^ 2 computation at max. Therefore, the overall time complexity will be O(N ^ 2).
O(1).
Since we are not using any extra space. Therefore, the overall space complexity will be O(1).