#P10448. 组合型枚举

组合型枚举

Problem Description

Randomly choose mm integers from the nn integers 1n1 \sim n, and output all possible selection schemes.

Input Format

Two integers n,mn, m, separated by a space on the same line.

Output Format

Output all schemes in increasing order, one scheme per line.

First, the numbers on the same line are in ascending order, and adjacent numbers are separated by one space.

Second, for two different lines, compare the numbers at the same positions one by one; the line with smaller lexicographical order comes first (for example, 1 3 5 7 comes before 1 3 6 8).

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

Hint

For all testdata, 0mn0 \le m \le n, and n+(nm)25n+(n-m) \le 25.

Translated by ChatGPT 5