#K12626. Triangle Pattern Generator

    ID: 23733 Type: Default 1000ms 256MiB

Triangle Pattern Generator

Triangle Pattern Generator

You are given a positive integer for each test case. Your task is to generate a triangle pattern based on the provided number. For a given positive integer \(N\), you should print a pattern that consists of \(N\) lines. In the pattern, the first line contains numbers from 1 to \(N\) separated by a single space, the second line contains numbers from 1 to \(N-1\), and so on until the last line which contains just the number 1.

If there are multiple test cases, the patterns for each test case should be printed in the order of input, and a blank line should separate the outputs of consecutive test cases.

Example:

Input:
1
3

Output: 1 2 3 1 2 1

</p>

inputFormat

The input consists of multiple test cases. The first line of input contains a single integer \(T\) denoting the number of test cases. Each of the following \(T\) lines contains one integer \(N\), which represents the number of rows for that test case.

Input Format:

T
N1
N2
... 
NT

outputFormat

For each test case, output the triangle pattern as described. For a given test case with input \(N\), print \(N\) lines where the \(i\)-th line (starting from 1) contains numbers from 1 up to \(N-i+1\) separated by a single space. If there are multiple test cases, separate the outputs for different test cases with a blank line.

## sample
1
2
1 2

1

</p>