P400: Enumeration of all $k$-ary trees with $n$ vertices

P400: Enumeration of all $k$-ary trees with $n$ vertices
Input:
Integers $k$ and $n$.
Output:
All $k$-ary trees with $n$ vertices
Complexity:
$O(1)$ time per solution
Comment:
Reference:
[Trojanowski1978] (Bibtex)