##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
3 3 2 2 3 1 2
6
2 2 2 1 2 2 1 2
9
2 3 0 0
1
A storage unit has dimensions , divided into a grid by horizontal dividers at rows through and vertical dividers at columns through . Some of these dividers are removed, merging adjacent compartments.
Given the indices of horizontal and vertical dividers to remove, find the area of the largest resulting compartment.
The storage unit is a grid (rows 0-3, columns 0-3) with 3 horizontal dividers and 3 vertical dividers. Removing horizontal dividers 2 and 3 merges rows 1, 2, 3 into one vertical span of size 3. Removing vertical divider 2 merges columns 1 and 2 into a horizontal span of size 2. The largest compartment is 6.
The grid is . Removing all horizontal dividers merges all 3 rows (span 3). Removing all vertical dividers merges all 3 columns (span 3). The entire storage becomes one compartment of area 9.
No dividers are removed. Every cell is its own compartment of size . The largest compartment has area 1.