Problem B
Candy Distribution
Kids like candy, so much that they start beating each other if the candy is not fairly distributed. So at your next party, you better start thinking before you buy the candy.
If there are
Usually, the candies are packed into bags with a fixed
number of candies
Input
The first line gives the number of test cases
Output
For each test case, print one line. If there is no such number of candy bags to fulfill the above constraints, print “IMPOSSIBLE”. Otherwise print the number of candy bags you want to buy. If there is more than one solution, any will do.
Sample Input 1 | Sample Output 1 |
---|---|
5 10 5 10 7 1337 23 123454321 42 999999937 142857133 |
IMPOSSIBLE 3 872 14696943 166666655 |