|
||||||||||
Number gameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 303 Accepted Submission(s): 36 Problem Description One day, QQ is playing a number game. He first sorts the N numbers 1, 2, 3¡n, but this is too easy. So long1 wants to challenge QQ¡¯s skill, he let the number sequence becomes wavy. For example, a1<a2>a3<a4>a5¡ or a1>a2<a3>a4<a5¡. Now long1 sorts these wavy sequences by lexicographic order, and he wants to know what the M-th sequence is when you have N numbers. As an Acmer, long1 thinks you can solve it and gives him the answer. Input There are many test cases: For every case: First line is the number of case The next case lines: Every line contains two numbers N, and M.(1<=N<=20,M is not larger than the number of wavy sequences) Output For every case, output the sequence. Sample Input
Sample Output
Hint Hint: You can assume that the number of total wavy sequences will not beyond INT64. Source | ||||||||||
|