Problem1392--选排列(递归入门4)(4.2)(课程ZJ)

1392: 选排列(递归入门4)(4.2)(课程ZJ)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

从1至N个数字中选M个排成一列,问有多少种方案?
全部按字典序列出。2<=N、M<=9,M<=N

Input

输入N和M。

Output

输出各种可能的排列,每种一行。

Sample Input Copy

3 2

Sample Output Copy

1 2
1 3
2 1
2 3
3 1
3 2

Source/Category

递归