SP23969 JARJAR - Helping Jar Jar Binks

Description

A job has been assigned to Jar Jar Binks, it goes as follows: There are N spaceships parts, each with a weight of Wi kg. Given a weight W, he has to show how many parts can be used in order to make a ship with a weight of exactly W kg. He has to show all possible solutions, of course if possible. Everybody knows Jar Jar Binks particularly because of his clumsiness, so you have to help him. Write a program that solves his problem!

Input Format

There will be several cases, each beginning with two integers N, Q (1

Output Format

Print a line with K integers per query in ascending order. They must represent the amount of pieces that can be used to make a spaceship with weight W. If there is no way to make a spaceship with weight W, output a line with the string “That's impossible!” (quotes to clarify)