Problem: Rectangle Shrinking
Part 1: Notations and Terminologies
$$$x$$$: Brick. $$$x_i,\,i=1,2$$$ means the part of $$$x$$$ that lies on the $$$i$$$-th floor. For example, if $$$x.u=1, x.d=2, x.l=3, x.r=4$$$, then $$$x_1.u=x_1.d=1, x_1.l=3, x_1.r=4$$$. $$$x_2.u=x_2.d=2, x_1.l=3, x_1.r=4$$$
$$$A_i,\,i=1,2$$$: The set of bricks whose $$$u=d=i$$$.
$$$B$$$: The set of bricks whose $$$u=1,\,d=2$$$.
\texttt{Remove}: Remove a brick.
\texttt{Shrink}: Decrease the size of a brick to a non-zero number.
\texttt{Keep}: Keep a brick unmoved.
Part 2: Idea
The first observation is that bricks in $$$B$$$ are difficult to handle. For example, if you \texttt{Shrink} $$$b \in B$$$ on the first floor, you have to \texttt{Shrink} $$$b$$$ on the second floor into the same shape as that on the first floor. So, there are a lot of restrictions for set $$$B$$$. Bricks in $$$A_1, A_2$$$ are much easier to handle. Therefore, the first key idea: Is there a solution that never