Type: Default 2000ms 256MiB

全排列

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.

Description

输出自然数 1n 所有不重复的排列,即 n 的全排列,要求所产生的任一数字序列中不允许出现重复的数字。

禁止使用STL,一经发现本题记0分。

Input Format

一个整数 n

Output Format

1n 组成的所有不重复的数字序列,每行一个序列。

每个数字保留 5 个场宽。

3​
    1    2    3
    1    3    2
    2    1    3
    2    3    1
    3    1    2
    3    2    1​

Hint

1≤n≤7