We are attempting to design a wall as a tessellation of 2D rectangular brick shapes, with all of the bricks having exact integer coordinates and exact integer sizes.
Given a description of the brickwork in this 2D wall, determine if the wall is indeed a wall—covering a perfect rectangle with no overlapping bricks and with no empty spaces in between bricks. This means that every non-integer-coordinate inside the region should be covered by exactly one brick.
![]() | ![]() | ![]() |
Brickwork illustrating samples 1, 2, and 3 respectively.
Output yes if the bricks constitute a valid wall, no otherwise.
50 0 5 11 1 4 40 1 1 51 5 5 15 0 1 5
yes
31 0 3 30 1 3 33 3 1 1
no
41 1 2 10 0 2 10 1 1 12 0 1 1
yes
| Name |
|---|


