GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

Dynamic programming to find maximum number of plots inside a rectangle


We have a rectangle R with sides: a,b (parallel to coordinate system) and a set P of points inside that rectangle (integers). A plot in the rectangle is a rectangle D:

1) that is inside of the rectangle R

2) which edges are parallel to coordinate system

3) inside which there is exactly 1 point from set P

4) which sides must belong to R's sides or lie on a line that contains at least 1 point from set P

Any ideas how to find the maximum number of plots D that you can cut the rectangle R at once?

Is it possible to solve the problem using dynamic programming?

asked Dec 5, 2016 by quaster