Arm Wrestling Tournament
As you might have heard, Mr. Kumis is holding an arm wrestling tournament. There are 2^N contestants who will participate in this tournament numbered from 1 to 2^N. The first contestant (C_1) will compete with the second contestant (C_2). C_3 will compete with the C_4, and so on. The winner of C_1 and C_2 will compete with the winner of C_3 and C_4. The winner of C_5 and C_6 will compete with the winner of C_7 and C_8, and so on (see the diagram below).
Each contestant initially has P_i strength. When two contestants wrestle, the stronger one will win and his strength will be reduced as much as his enemy's strength. However, before his next match, he has time to regain his strength and will recover at most K strength but his strength will not exceed his initial strength (Pi). If two contestants possess an equal strength then the contestant with smaller index will win.
Given the initial strength of all contestants, determine who will win the tournament and which contestant he will beat.
Input
The first line of input contains an integer T (T ≤ 100) denoting the number of testcases. Each testcase begins with two integer N (1 ≤ N ≤ 15) and K (0 ≤ K ≤ 1, 000). The next line contains 2^N integers Pi (1 ≤ Pi ≤ 1, 000) denoting the initial strength of i-th contestant for i = 1..2^N.
Output
For each testcase, print two lines. The first line contains an integer, the winner of the tournament. The second line contains N integers which are all contestants the winner beat based on match order. Each integer is separated by a single space.