#K52367. Generate Sequence

    ID: 29294 Type: Default 1000ms 256MiB

Generate Sequence

Generate Sequence

You are given a positive integer N. Your task is to generate a sequence of N integers following these rules:

  • The first element of the sequence is 1.
  • For each subsequent element, add the current index (starting at 1) to the previous element.

In mathematical notation, the sequence \(a_1, a_2, \dots, a_N\) is defined as:

[ a_1 = 1, \quad a_{i+1} = a_i + i \quad \text{for } 1 \le i < N. ]

You will be given multiple test cases. For each test case, output the generated sequence as space‐separated integers on a new line.

Example:

Input:
3
3
5
1

Output:
1 2 4
1 2 4 7 11
1

inputFormat

The first line of input contains a positive integer T denoting the number of test cases (T > 0). Each of the following T lines contains a single positive integer N which represents the length of the sequence to be generated.

Constraints:

  • 1 ≤ N ≤ 105 (for each test case)
  • 1 ≤ T ≤ 103

outputFormat

For each test case, output a single line that contains the generated sequence of N integers. The numbers in the sequence should be separated by a single space.

## sample
3
3
5
1
1 2 4

1 2 4 7 11 1

</p>