#K77202. Ball Arrangement Without Adjacent Identical Colors

    ID: 34812 Type: Default 1000ms 256MiB

Ball Arrangement Without Adjacent Identical Colors

Ball Arrangement Without Adjacent Identical Colors

You are given two non-negative integers representing the number of red balls (R) and blue balls (B). Your task is to determine whether it is possible to arrange all the balls in a row such that no two adjacent balls have the same color.

The necessary and sufficient condition for such an arrangement to exist is that the absolute difference between the number of red and blue balls does not exceed 1, i.e., $$|R - B| \le 1$$.

If the condition holds, output Possible; otherwise, output Not Possible.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains a single integer T denoting the number of test cases.
  • Each of the next T lines contains two space-separated integers R and B, representing the number of red and blue balls respectively.

outputFormat

For each test case, output a single line to standard output (stdout) containing either Possible if it is feasible to arrange the balls according to the rule, or Not Possible otherwise.

## sample
3
3 4
1 3
10 0
Possible

Not Possible Not Possible

</p>