Warehouse Storage Optimization#660

Warehouse Storage Optimization

0.3 seconds
64 megabytes
Very easy

A modern logistics company operates an automated warehouse with multiple storage sections. Each storage section is organized as an 8 \times 8 grid of storage cells. The warehouse uses an intelligent robot system that places standardized rectangular shipping containers, where each container occupies exactly adjacent cells (either horizontally or vertically).

Recently, the facility manager noticed that some storage cells in various sections have become damaged or blocked due to structural issues. Specifically, exactly cells in each affected section are unusable. The warehouse management system needs to determine whether the robot can still achieve optimal storage utilization by completely filling all remaining cells with the standard containers.

The robot analyzed the situation: after marking cells as unusable, there are usable cells remaining in each section. With standard containers available (since each container covers cells), the question becomes: can these containers perfectly tile the remaining usable space?

The warehouse operations team decided to run simulations for multiple storage sections. For each section, they want to know whether complete coverage is possible or if some space will remain unused.

Your task is to write a program that analyzes each storage section configuration and determines whether the robot can achieve complete coverage with the available containers, given the coordinates of the blocked cells.

Input

The first line contains the number of storage sections to analyze, (1 \leq N \leq 100). The next lines each contain integers: the coordinates of the two blocked cells in the current section (row and column for each blocked cell).

Output

In a single line without spaces, output a sequence of (complete coverage impossible) and (complete coverage possible) based on the analysis result for each storage section.

Examples

Example 1

Loading
Loading