All permutations of given length
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given number n. Print all permutations of numbers from 1 to n in lexicographical order.
Input
One number n (0 < n < 10).
Output
Print all permutations of numbers from 1 to n in lexicographical order. Print each permutation in a separate line. Do not print spaces between numbers in one line.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 63%