#K61682. Taco Tournament Challenge

    ID: 31364 Type: Default 1000ms 256MiB

Taco Tournament Challenge

Taco Tournament Challenge

You are given a positive integer n. Your task is to generate a sequence from n down to 1 using the following rules:

  • If n is even, update it to $$n = \frac{n}{2}$$.
  • If n is odd, update it to $$n = n - 1$$.

The process stops when n becomes 1. You will be given multiple test cases; for each test case, output the corresponding sequence with numbers separated by a space.

Note: All formulas are rendered in \(\LaTeX\) format.

inputFormat

The first line contains a single integer T (the number of test cases). Each of the following T lines contains one integer n.

Constraints: 1 ≤ n ≤ 109 (assumed for this problem).

outputFormat

For each test case, print a single line containing the sequence of integers generated from n to 1, with each number separated by a space.

## sample
3
6
15
8
6 3 2 1

15 14 7 6 3 2 1 8 4 2 1

</p>