Permutations of n by k#9961

Permutations of n by k

1 Sekunde
64 Megabyte
Sehr leicht

Given two natural numbers and , print all possible -length permutations of integers from to in lexicographic order.

Eingabe

Two natural numbers and (1 \leq k \leq n \leq 8).

Ausgabe

Print all possible -length permutations of integers from to in lexicographic order. Each permutation should be displayed on a separate line.

Beispiele

Beispiel 1

Loading
Loading