you give rectangular cake size h x w array integer horizontalcut verticalcut wherehorizontalcutsi distance rectangular cake ith horizontal cut similarly andverticalcutsj distance leave rectangular cake jth vertical cutReturn maximum area piece cake cut horizontal vertical position provide array horizontalcut verticalcut since answer large number return modulo 109 7 Example 1input h 5 w 4 horizontalcut 124 verticalcut 13output 4 Explanation the figure represent give rectangular cake Red line horizontal vertical cut after cut cake green piece cake maximum areaExample 2input h 5 w 4 horizontalcut 31 verticalcut 1output 6explanation the figure represent give rectangular cake Red line horizontal vertical cut after cut cake green yellow piece cake maximum areaExample 3input h 5 w 4 horizontalcut 3 verticalcut 3output 9 constraints2 h w 1091 horizontalcutslength minh 1 1051 verticalCutslength minw 1 1051 horizontalCutsi h1 verticalCutsi wAll element horizontalcut distinctAll element verticalcut distinct