#C512. Bib Distribution Feasibility

    ID: 48734 Type: Default 1000ms 256MiB

Bib Distribution Feasibility

Bib Distribution Feasibility

You are given T test cases. Each test case consists of two integers, N and K, where N represents the number of participants and K is a parameter related to the distribution of bib numbers. The problem is to determine whether it is possible to assign bib numbers such that the sum of bib numbers for any subset of exactly K participants is distinct from the sum for any subset of participants with more than K members.

After careful analysis, it turns out that the feasibility of this distribution depends solely on the relation between K and N. The condition is that the distribution is possible if and only if

[ K \leq \lfloor N/2 \rfloor ]

Otherwise, if

[ K > \lfloor N/2 \rfloor ]

it is impossible to achieve the required property.

For each test case, output "Possible" if a valid distribution exists, or "Impossible" otherwise.

inputFormat

The first line contains an integer T, the number of test cases. Each of the following T lines contains two space-separated integers, N and K.

outputFormat

For each test case, output a single line with either "Possible" or "Impossible" based on whether the distribution can satisfy the condition.## sample

4
5 2
6 4
4 2
8 3
Possible

Impossible Possible Possible

</p>