#arc084c. [arc084_c]Finite Encyclopedia of Integer Sequences
[arc084_c]Finite Encyclopedia of Integer Sequences
Problem Statement
In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between and (inclusive) consisting of integers between and (inclusive) are listed.
Let the total number of sequences listed in FEIS be . Among those sequences, find the -th (rounded up to the nearest integer) lexicographically smallest one.
Constraints
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the -th (rounded up to the nearest integer) lexicographically smallest sequence listed in FEIS, with spaces in between, where is the total number of sequences listed in FEIS.
Sample Input 1
3 2
Sample Output 1
2 1
There are sequences listed in FEIS: $(1),(1,1),(1,2),(1,3),(2),(2,1),(2,2),(2,3),(3),(3,1),(3,2),(3,3)$. The -th lexicographically smallest one among them is .
Sample Input 2
2 4
Sample Output 2
1 2 2 2
Sample Input 3
5 14
Sample Output 3
3 3 3 3 3 3 3 3 3 3 3 3 2 2