#K45477. Taco Bags Distribution Problem
Taco Bags Distribution Problem
Taco Bags Distribution Problem
You are given a number of marbles, n, and you need to determine whether it is possible to partition them into exactly m bags under a specific rule:
If \(m = 1\), then it is only possible if \(n = 1\). Otherwise, the partitioning is possible if and only if \(m \leq n\). In each test case, output POSSIBLE if the condition holds and IMPOSSIBLE otherwise.
For example, if \(n = 10\) and \(m = 5\), since \(5 \leq 10\), output POSSIBLE; however, if \(n = 1000000000\) and \(m = 1\), since \(n \neq 1\), output IMPOSSIBLE.
inputFormat
The first line contains an integer T (\(1 \leq T \leq 10^5\)) representing the number of test cases. Each of the next T lines contains two space-separated integers n and m, where n is the number of marbles and m is the desired number of bags.
outputFormat
For each test case, print a single line containing POSSIBLE if it is possible to obtain exactly m bags from n marbles under the given rule; otherwise, print IMPOSSIBLE.
## sample5
10 5
5 5
12 6
15 3
1000000000 1
POSSIBLE
POSSIBLE
POSSIBLE
POSSIBLE
IMPOSSIBLE
</p>