Candy Distribution#3775

Candy Distribution

1 second
64 megabytes
Very easy

Kids like candies, so much that they start beating each other if the candies are not fairly distributed. So on your next party, you better start thinking before you buy the candies.

If there are kids, we of course need K \cdot X candies for a fair distribution, where is a positive natural number. But we learned that always at least one kid loses one candy, so better be prepared with exactly one spare candy, resulting in (K \cdot X) + 1 candies.

Usually, the candies are packed into bags with a fixed number of candies . We will buy some of these bags so that the above constraints are fulfilled.

Input

The first line gives the number of test cases (0 < t < 100). Each test case is specified by two integers and on a single line, where is the number of kids and the number of candies in one bag (1 \le K, C \le 10^9). As your money is limited, you will never buy more than 10^9 candy bags.

Output

For each test case, print one line. If there is no such number of candy bags to fulfill the above constraints, print "IMPOSSIBLE" instead. Otherwise print the number of candy bags, you want to buy. If there is more than one solution, any will do.

Examples

Example 1

Loading
Loading