Preparing NOJ

Subset sequence

1000ms 32768K

Description:

Consider the aggregate An= { 1, 2, …, n }. For example, A1={1}, A3={1,2,3}. A subset sequence is defined as a array of a non-empty subset. Sort all the subset sequece of An in lexicography order. Your task is to find the m-th one.

Input:

The input contains several test cases. Each test case consists of two numbers n and m ( 0< n<= 20, 0< m<= the total number of the subset sequence of An ).

Output:

For each test case, you should output the m-th subset sequence of An in one line.

Sample Input:

1 1
2 1
2 2
2 3
2 4
3 10

Sample Output:

1
1
1 2
2
2 1
2 3 1

Info

HDU

Provider HDU

Origin 校庆杯Warm Up

Code HDU2062

Tags

Submitted 1

Passed 1

AC Rate 100%

Date 06/03/2019 16:25:34

Related

Nothing Yet