402792: GYM100883 C Too Many Coins

Memory Limit:64 MB Time Limit:4 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Too Many Coinstime limit per test4 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Your friend has C coins in his pocket, each coin has a value Vi, and you know that he will not need that amount of money, he will only need M.

You want to help him not to carry all these coins, so you decided to tell him to take the coins of specific values, in a way that he will have at least the amount of money he needs.

You will tell him that it will be enough for him if he carried coins of types X1, X2, ..., Xn.

Note that if you tell him to carry coins of type Xi, he will carry all the coins with values Vi = Xi.

Input

The first line contains an integer T representing the number of test cases.

Each test case consists of two lines, the first line has two integers C (1 ≤ C ≤ 1000000) and M (1 ≤ M ≤ 109), and the other line contains C integers representing the values of the coins (1 ≤ Vi ≤ 1000000).

Output

For each test case print the types of coins which your friend must carry,if there are multiple solutions, print the solution with the minimum number of types, if there are still multiple solutions print the one which makes your friend carry more money, if there are still multiple solutions print the solution with the bigger types.

print the types in increasing order. If he doesn't have enough money print "Impossible" without the quotations.

ExamplesInput
3
10 7
1 1 1 1 1 2 2 2 5 4
10 11
1 1 1 1 1 1 1 1 1 1
10 6
1 1 1 1 1 1 2 2 2 3
Output
2 5
Impossible
2

加入题单

上一题 下一题 算法标签: