#C10535. Strictly Increasing Sequences

    ID: 39751 Type: Default 1000ms 256MiB

Strictly Increasing Sequences

Strictly Increasing Sequences

Given an integer \( n \) (where \(1 \le n \le 9\)), print all unique, strictly increasing sequences of length \( n \) consisting of digits from 0 to 9. In each sequence, the digits must be distinct and arranged in increasing order. Each sequence should be printed on a separate line with the digits separated by a single space.

Example:

Input: 2
Output:
0 1
0 2
0 3
...
8 9

Note that the sequences are generated in lexicographical order. Use standard input to read the value of \( n \) and standard output to print the sequences.

inputFormat

A single integer ( n ) provided via standard input, where (1 \le n \le 9).

outputFormat

Print all strictly increasing sequences of length ( n ) formed from the digits 0 to 9. Each sequence must appear on a new line, with the digits separated by a single space.## sample

2
0 1

0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 4 3 5 3 6 3 7 3 8 3 9 4 5 4 6 4 7 4 8 4 9 5 6 5 7 5 8 5 9 6 7 6 8 6 9 7 8 7 9 8 9

</p>