Update appNew update is available. Click here to update.

Magical Pattern

Last Updated: 3 Aug, 2020
Difficulty: Easy

PROBLEM STATEMENT

Try Problem

You have been given an integer 'N'. Your task is to print the Magical Pattern(see examples) for the given 'N'.

Example :

For 'N' : 4
Pattern :
4 3 2 1 2 3 4                                                                   
3 3 2 1 2 3 3                                                                   
2 2 2 1 2 2 2                                                                   
1 1 1 1 1 1 1                                                                   
2 2 2 1 2 2 2                                                                   
3 3 2 1 2 3 3                                                                   
4 3 2 1 2 3 4
Input Format :
The first input line contains an integer 'T', the number of test cases. Then 'T' test cases follow.

The first and the only line of input contains the integer 'N'.
Output Format :
For each test case print the Magical Pattern as shown in the example. 
Note :
You don't need to print anything. It has already been taken care of, just implement the given function.
Constraints :
1 <= T <= 10
1 <= N <= 10^2

Time Limit : 1 sec