#C4029. Distinct Positive Integer Sequences

    ID: 47522 Type: Default 1000ms 256MiB

Distinct Positive Integer Sequences

Distinct Positive Integer Sequences

Given a positive integer \( T \), find all distinct sequences of positive integers in non-decreasing order that sum up to \( T \). Each sequence must be printed on a new line and the integers in a sequence should be separated by a single space.

For example, if \( T=5 \), the valid sequences are:

1 1 1 1 1
1 1 1 2
1 1 3
1 2 2
1 4
2 3
5

Your task is to generate all such sequences using a recursive approach.

inputFormat

The input is read from standard input and consists of a single positive integer \( T \).

outputFormat

Print each valid sequence on a new line. Within each line, print the integers of the sequence separated by a single space. The order of sequences must follow the order in which they are generated recursively (i.e. non-decreasing order in each sequence).

## sample
1
1