There has been a water incident on the top floor of a building, and one apartment has suffered some water damage. As in, a lot of water damage. The entire apartment is filled waist deep with dihydrogen monoxide. As a contractor, you are tasked with getting the liquid out. All plumbing is out of order due to the aforementioned incident, and there is no feasible way to get any pumping equipment up into the apartment. The only way the get the water out is to break some walls and floors to allow the water to flow freely into a well on the ground floor (marked red).
You propose a way to get the water out along the hallways to avoid flooding any of the other apartments. However, the landlord will have to pay for repairs on the rooms used to pass the water through, and the price is solely dependent on the affected area (i.e. repairing one square of the hallway costs the same as repairing one square of an apartment). For that reason, the landlord will gladly allow you to pass through another apartment if that means a smaller overall area will be used to get the water out.
Rules:
- You can make a hole in the wall or floor of any room (apartment or hallway) currently containing water, but not the outer walls of the building.
- Once a hole is made on a wall piece, the water spreads out through it to fill the available area evenly.
- Once a hole is made on a floor piece, all of the water flows down to the next floor below and fills the available area evenly.
- Once the water reaches the well, all of it will flow in and the mission is complete.
- There is no extra cost in fixing holes made on walls/floors, so make as many holes as is necessary to get the water out.
- Water does not flow upwards.
- There is no elevator or stairwell, because who thinks of those things when drawing a building.
How many squares will the landlord need to repair after you've gotten the water out? While keeping the number of squares at a minimum, what is the minimum number of other apartments (gray rectangles) that you must temporarily fill with water?
Initial situation
Rejected proposal (Holes are marked with X's)