Problem I. Sequence two

时间限制 1 ms   内存限制 32 MB

Search is important in the acm algorithm. When you want to solve a problem by using the search method, try to cut is very important.
Now give you a number sequence, include n (<=100) integers, each integer not bigger than 2^31, you want to find the first P subsequences that is not decrease (if total subsequence W is smaller than P, than just give the first W subsequences). The order of subsequences is that: first order the length of the subsequence. Second order the subsequence by lexicographical. For example initial sequence 1 3 2 the total legal subsequences is 5. According to order is {1}; {2}; {3}; {1,2}; {1,3}. If you also can not understand , please see the sample carefully.
 

输入数据

The input contains multiple test cases.
Each test case include, first two integers n, P. (1<n<=100, 1<p<=100000).
 

输出数据

For each test case output the sequences according to the problem description. And at the end of each case follow a empty line.
 

样例输入

复制
3 5
1 3 2
3 6
1 3 2
4 100
1 2 3 2

样例输出

复制
1
2
3
1 2
1 3

1
2
3
1 2
1 3

1
2
3
1 2
1 3
2 2
2 3
1 2 2
1 2 3

提交

请先 登录

© 2025 FAQs Contact About