maximal sub-rectangle: caching FTW