SP1673 AMBM - Ambitious Manager
Description
The Bogus Corporation distributes salary to its employees in a weird manner. The salary is distributed every K days, and instead of same salary for each day, the salary for the i $ ^{th} $ day is a $ _{i} $ . An ambitious young manager, fresh from Institute of Mismanagement, observes that people usually prefer to take leave towards the end of this period of K days, when the workload is higher. Instead of revising each of the a $ _{i} $ 's, the manager comes up with a quick fix solution - he redefines the new salary on the i $ ^{th} $ day as b $ _{i} $ =a $ _{i} $ +2a $ _{i-1} $ +2 $ ^{2} $ a $ _{i-2} $ +2 $ ^{3} $ a $ _{i-3} $ +........+2 $ ^{i-1} $ a $ _{1} $ . Baba, one of the employees, is in a dire financial crisis, and must accumulate at least N rupees at the end of the forthcoming period. Being a lazy worker that he is, he is interested in finding out if attending particular days would guarantee him exactly N rupees at the end of the period. Can you help Baba?
Input Format
First line contains a single integer integer T, the number of test cases ( 1
Output Format
For each test case, output on a single line 1-based indices of the days (separated by a single space) he should attend to ensure a salary of exactly N rupees at the end of the period. The indices should be printed in the sorted order. In case of multiple answers, output any one of them. If there is no answer, print -1.