#t342. 全排列问题
全排列问题
Permutations
Problem Background
Special for beginners, ^_^
Problem Description
Output all distinct permutations of the natural numbers to , i.e. all permutations of . In any produced sequence, no digit may be repeated.
Input Format
One natural number .
Output Format
All distinct sequences composed of the numbers , one sequence per line, with the numbers separated by a single space.
Sample Input
3
Sample Output
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
Constraints
1s, 1024KiB for each test case.