组合的输出
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Background
Special for beginners, ^_^
Description
排列与组合是常用的数学方法,其中组合就是从 个元素中抽出 个元素(不分顺序且 ),我们可以简单地将n 个元素理解为自然数 ,从中任取 个数。现要求你用递归的方法输出所有组合。
Format
Input
一行两个自然数 (,)
Output
所有的组合,每一个组合占一行且其中的元素按由小到大的顺序排列,每个元素前面包含一个空格(包括第一个元素)
Samples
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
Limitation
1s, 1024KiB for each test case.